[rabbitmq-discuss] EventMachine EM::Iterator being blocked with rabbitmq rbc
michael.s.klishin at gmail.com
Fri Jan 6 07:44:33 GMT 2012
> The above code works as I want with one annoying exception. Something is blocking the EM::Iterator code from being executed asynchronously. It is only after the EM::Iterator code has completed that the messages are sent. I want the messages to be sent asynchronously and handled by the anonymous queue after each iteration. At the moment, it is only after the EM::Iterator code has completed its last iteration that all the messages are sent.
This is a question for EventMachine mailing list. EventMachine::Iterator is only available in beta releases of EventMachine 1.0, so use it with caution.
> Can anyone see what I am doing wrong or suggest a different approach? I tried EM::defer and had the same behaviour.
EventMachine.defer uses a thread pool with 20 threads by default. If operations you defer to it are blocked, it may suggest that the issue is not with something blocking the event loop.
For example, you are using prefetch = 1 and manual acknowledgements for your consumer that uses EventMachine::Iterator. However, I don't see messages being acknowledged.
You can use Wireshark GUI to record a session of what's going up and down the wire (filter for "amqp").
More information about the rabbitmq-discuss