Closed guiguem closed 5 years ago
From @laroque on September 19, 2015 5:16
ugh... why do I keep doing this to myself, the send_request method of service is blocking, which means that it cannot then handle_reply because it is still trying to send_request.... python 3's yield from syntax may offer a nice solution to this, I'll play with pika 0.10 and python 3.4 at some point, but for now I should give up
As a note, as of pika 0.11.0, there now exists an AsyncConnection adapter natively in pika, which uses asyncio's event loop. It may be possible to change the adapter with few other changes to the service class and achieve asynchronous message handling. Since we haven't worked with 0.10.0 we should be sure to jump to 0.11.0 and leverage this feature whenever we decide to jump into this.
We are migrating away from pika and will solve this with pybind'ing dripline-cpp
From @laroque on September 18, 2015 23:46
WARNING!... this isn't actually a starter project, it is kind of advanced.
Currently the sending a request involves using threading and a new connection to send a message and get a reply. This feels super dirty. I'd like to do something like:
... but I haven't got a solution for the yielding code block
should just send a request and then watch some local dictionary of responses for one with a matched correlation_id... need to have solutions to two issues: 1) still need to support timeout for getting the reply 2) need to make sure data-structures don't grow without bound if either replies collect but never get sent anywhere, or records of replies awaiting with reply do not grow similarly
Copied from original issue: project8/dripline#135