Fulfilling a promise from another thread is *NOT* safe (see https://groups.google.com/forum/#!topic/capnproto/zSmTdNGdWg8). I'm not sure how to accomplish what you're trying to do with pycapnp today, sorry.
Ideally, pycapnp would grow the ability to integrate with other event loops, but I'm not sure that's coming anytime soon. On Wed, Nov 9, 2016 at 3:26 AM, Andreas Stenius <[email protected]> wrote: > Hi, > > I'm implementing a RPC server, which should be able to call a function on > a client's object. But, I want to be able to initiate the call from the > server outside of the event loop (or trigger something that will result in > the call being made). > > The examples in pycapnp regarding threads and the event loop used the > getTimer() to delay a call, and thinking along those lines, I tried to see > if I simply could create my own promise, and fullfill that from another > thread at a later time, but haven't figured out how to do it, if at all > possible. > > To give a little more context, what I have is a flask app, and a rpc > server, living in the same process. And I want to call a function on a > client provided object over capnp-rpc from the flask app thread. > > Any hints/pointers ideas welcome :) > > Thanks, > Andreas > > -- > 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. > -- 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.
