I am trying to use pycapnp to allow a client to ask a server to do a long 
running function. During this function, I want the server to send the 
client some feedback messages. My capnp file looks something like this:

interface Performer {


  performFunction @0 ();


  bind @1 (watcher: Watcher);


}


interface Watcher {


  update @0 (feedback: Text);


}



I can bind my watchers to the performers successfully using TwoParty 
Server/Client. However, when I call performFunction I do not get any update 
messages back until the performFunction exits, and all the updates are 
dumped out at once. My desired outcome is for the watcher to be notified of 
the updates each iteration (each time the Performer calls the Watcher's 
update function).

I assume this is because the performfunction is blocking the capnp thread.

If I run the update in a different thread I get an error: kj/async.c++:227: 
failed: expected head == nullptr; EventLoop destroyed with events still in 
the queue.  Memory leak?;.
If I run the update in a different thread that I call 
`capnp.create_event_loop(threaded=True)` in The funciton is performed, but 
the Watcher never receives updates.

Any ideas on how I can get this type of feedback to work with pycapnp?

-- 
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 [email protected].
Visit this group at https://groups.google.com/group/capnproto.

Reply via email to