[rabbitmq-discuss] Using Pika's add_on_return_callback with a BlockingConnection?

Gavin M. Roy gmr at meetme.com
Thu Aug 23 17:07:53 BST 2012


It should be fine to invoke this directly. If it were meant to be private it'd be prefixed with an underscore. I'll note that it needs to be added to the docs.

Gavin


On Thursday, August 23, 2012 at 12:04 PM, Matt Pietrek wrote: 
> Pinging again on this thread. Gavin?
> 
> Thanks,
> 
> Matt
> 
> On Fri, Aug 17, 2012 at 4:11 PM, Matt Pietrek <mpietrek at skytap.com (mailto:mpietrek at skytap.com)> wrote:
> > Update on this: I came across the BlockingConnection.process_data_events() method, which seems to do the trick if I insert it into my loop.
> > 
> > However, it doesn't look like an "official" API, in that I don't see it described anywhere, and the only search results I get for it are its inclusions in various callstacks.
> > 
> > Gavin (or whomever else wants to comment): What are your thoughts on this?
> > 
> > Thanks,
> > 
> > Matt
> > 
> > 
> > On Fri, Aug 17, 2012 at 3:52 PM, Matt Pietrek <mpietrek at skytap.com (mailto:mpietrek at skytap.com)> wrote:
> > > I'm got a scenario where I use a dedicated thread to write a series of messages in a loop. This thread uses BlockingConnection, calls add_on_return_callback for its channel, and when publishing, uses the mandatory=True flag.
> > > 
> > > I want to know when a message is being returned. However, I can't figure out what to call within my loop to give Pika the opportunity to see the Basic.Return message and invoke the callback.
> > > 
> > > I've verified via WireShark that the Basic.Returns are coming back from the broker. However, I can't figure out what the moral equivalent of calling ioloop.start() is, so as to give Pika the an opportunity to process the basic.return messages, but without blocking indefinitely. Just for kicks I tried calling Channel.basic_get() within the loop, and (as expected), I didn't get the returned message callbacks.
> > > 
> > > Thanks,
> > > 
> > > Matt
> > > 
> > 
> 
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com (mailto:rabbitmq-discuss at lists.rabbitmq.com)
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
> 
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120823/800e02f0/attachment.htm>


More information about the rabbitmq-discuss mailing list