[rabbitmq-discuss] Difference between async connection using ioloop and blocking connection for rabbitmq

Ameya Patil Ameya.Patil at servicenow.com
Tue Mar 5 23:14:45 GMT 2013


Hi,

Ioloops in async connection is exhibiting blocking semantics. I am trying to understand how this is different than a blocking connection


The documentation (https://pika.readthedocs.org/en/latest/connecting.html#io-and-event-looping ) states:

These IOLoops are blocking methods which loop and listen for events.


In a experiment I conducted, I publish 2 messages, each 5 times: message 'test' published by AsyncPublisher and 'test1' by AsyncPublisher1.py.


In the consumer I have an if block stating:

If body == test:

    Time.sleep(10)


I run AsyncPublisher.py first, and after it has sent 5 test messages I run AsyncPublisher1.py.


The output I expect is :

Test

test1

test1

test1

tes1

Test

Test

Test

Test


Instead I get:

Test

Tes

Test

Test

Test

test1

test1

test1

test1

test1


This is the same as if I would run the sender and receiver using a blocking connection.

My question is how does a blocking connection different than ioloop.start ? Does it differ only on multithreading ?


Thanks,

Ameya

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130305/5d85a199/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AsyncConsumer.py
Type: text/x-python-script
Size: 12690 bytes
Desc: AsyncConsumer.py
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130305/5d85a199/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AsyncPublisher.py
Type: text/x-python-script
Size: 12927 bytes
Desc: AsyncPublisher.py
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130305/5d85a199/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AsyncPublisher1.py
Type: text/x-python-script
Size: 12928 bytes
Desc: AsyncPublisher1.py
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130305/5d85a199/attachment-0002.bin>


More information about the rabbitmq-discuss mailing list