Can I use Pika BlockingConnection in a web application?

I'm a little confused about BlockingConnectionand AsyncoreConnection. I want to send some messages to the RabbitMQ queue from a Django application. Can this be done using a global object BlockingConnection?

Thank.

+4
source share
1 answer

You should have one BlockingConnectionobject per thread, as indicated in the pika FAQ :

Pika has no idea about flow in code. If you want to use a threaded Pika, make sure you have a Pika connection for the thread created in that thread. It is not safe to share one Pika connection in streams.

, , Django. Django , BlockingConnection; . , BlockingConnection.

+4

All Articles