It looks like capnp.wait_forever() is actually implemented as
kj::NEVER_DONE.wait() under the hood.

Can you provide more complete example code that we would be able to build
and run?

-Kenton

On Wed, Feb 14, 2018 at 2:45 PM, <cody.m.grif...@gmail.com> wrote:

> I have a use-case which is similar to streaming RPC to a server written in
> C++ - here is a simplified example:
>
> # Setup a client and connect it to our task server
> client = capnp.TwoPartyClient('localhost:8000')
> task_mgr = client.bootstrap().cast_as(schema.Task)
>
> class Notifier(schema.Notifier.Server):
>     def notify(self, params, **kwargs):
>         print "notifying"
>
> task = task_mgr.create(type=0)
> n = Notifier()
> task.add_notifier(n).wait()
>
> task.run().wait()
>
> capnp.wait_forever()
>
> The C++ server will kick off the task which will call the notifier's
> notify asynchronously.  The C++ client works as expected (I get notify
> callbacks when the task wants to notify).  The python client seems to be
> unable to pump the message loop.  I see an example with a threaded client
> which involves repeatedly chaining promises to make something like this
> work, but is there an easier way?
>
> I was hoping that the capnp.wait_forever() would take care of pumping the
> loop and executing any callbacks, similar to my 
> kj::NEVER_DONE.wait(client.getWaitScope());
> in the C++ client...
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Cap'n Proto" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to capnproto+unsubscr...@googlegroups.com.
> Visit this group at https://groups.google.com/group/capnproto.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capnproto+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/capnproto.

Reply via email to