[rabbitmq-discuss] Using BlockingConnection in Pika

Joshua Braegger rckclmbr at gmail.com
Tue Jul 5 22:04:53 BST 2011


Thanks, Jason.

I bring this up because of this comment --
http://tonyg.github.com/pika/connecting.html#adapters-blocking-connection-blockingconnection

"*Warning* BlockingConnection is provided for legacy and learning purposes
only and it is not recommended that you use it for a production
application."

The latest git documentation also still has this warning (
https://github.com/pika/pika/blob/master/pika/adapters/base_connection.py)

"adapters.blocking_connection.BlockingConnection: Enables blocking,

  synchronous operation on top of library for simple uses. This is not
  recommended and is included for legacy reasons only."


So my question is, why isn't this recommended for production use?

-Josh


On Tue, Jul 5, 2011 at 2:52 PM, Jason J. W. Williams <
jasonjwwilliams at gmail.com> wrote:

> Hi Josh,
>
> I think BlockingConnection has found new life in the latest Pikas. At least
> Gavin has put a lot of effort in for those of us that have requested it for
> teaching etc.
>
>
> https://github.com/rabbitinaction/sourcecode/blob/master/python/chapter-2/hello_world_producer.py
>
> -J
>
> On Tue, Jul 5, 2011 at 2:50 PM, Joshua Braegger <rckclmbr at gmail.com>wrote:
>
>> Howdy,
>>
>> I'm looking at the Pika documentation, and it's mentioning that using
>> BlockingConnection is deprecated.  The alternative is to use an
>> asynchronous model like SelectConnection.  This works fairly well for
>> consumers, but producing one-off messages leaves more to be desired.
>> BlockingConnection satisfies the case fairly well -- Create a global
>> connection, send many messages, close the connection.  It gets hairy
>> when attempting to work asynchronously within a synchronous
>> application.  Especially given the fact I want to use the "mandatory"
>> flag, and know when any message fails to be enqueued in a synchronous
>> manner.
>>
>> Are there any best practices to doing this?  Is the answer to just use
>> BlockingConnection?
>>
>> Thanks,
>> -Josh
>> _______________________________________________
>> rabbitmq-discuss mailing list
>> 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/20110705/3bafc34b/attachment.htm>


More information about the rabbitmq-discuss mailing list