I've looked into implementing DeferredQueue for set_return_handler instead of synchronous callbacks and has a few basic questions. For one, from my understanding the AMQClient.queues is specifically for consumer queues and nothing else, right? If I'm right I assume I would need to segregate returns from deliveries.
Secondly, can you provide a minimal example showing what you think is the best API is for handling basic.return. For example something along the lines of the following for basic.consumer to delivery:
Hi Esteve,
I've looked into implementing DeferredQueue for set_return_handler instead of synchronous callbacks and has a few basic questions. For one, from my understanding the AMQClient.queues is specifically for consumer queues and nothing else, right? If I'm right I assume I would need to segregate returns from deliveries.
Secondly, can you provide a minimal example showing what you think is the best API is for handling basic.return. For example something along the lines of the following for basic.consumer to delivery:
reply = yield channel. basic_consume( queue=" test-queue" , no_ack=True) queue(reply. consumer_ tag) timeout= 1)
queue = yield self.client.
msg = yield queue.get(
My guess is the interface might put the responsibility on invoking callbacks on the user, so we'd have something like:
@inlineCallbacks return_ queue() timeout= 1)
def return_checker():
queue = yield self.client.
(ch, return_msg) = yield queue.get(
... do something with message
checker = LoopingCall( return_ checker)
checker.start(5)
...
Then we'd remove set_return_handler?
Please let me know if this is what you're considering.
Thanks.