[rabbitmq-discuss] pika library: pass channel to channel state-change callback?

Sigurd Høgsbro sigurd.hogsbro at museeka.com
Wed Sep 1 17:08:38 BST 2010


Sorry if discussion on pika is out of scope of this mailing-list, but I
thought it preferential to mailing Tony directly.

I'm use pika's asyncore programming model, and find it an excellent model
for dealing with connection & channel setup/teardown.

I have an issue on the channel state callback, which currently passes the
ChannelHandler() as a parameter to the callback. As I understand it, the
ChannelHandler() is not an object intended for client app usage, and does
not that I can see provide any methods useful to the client app.

As it works now, I cannot create a function to allocate a channel (using
pika.AsyncoreConnection.channel()) and setup the callbacks (using
channel.addStateChangeHandler()), as the channel state callback is called
before I can store the reference to the returned Channel() object in my
containing object.

By replacing the ChannelHandler() object with the Channel() reference
instead then the obvious channel operations (declaring of queues etc) could
use this parameter and avoid the catch-22 issue.

If there is general agreement to this change I'm happy to commit the
required changes to Github.

Cheers,

Sigurd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20100901/00d18714/attachment.htm>


More information about the rabbitmq-discuss mailing list