gmr/rabbitpy — pull request #27 by kristaps (2014-04-13 19:50:47+00:00)
Title: Use Queue.get instead of time.sleep to delay AMQPFrame._wait_for_frame iterations.

The example at https://gist.github.com/kristaps/10599120 can process ~10 msgs/s, due to the mandatory 0.1s sleep in _wait_on_frame, if there is no frame available on first iteration (happens on every message for me). I propose using the timeout param of the Queue.get call in AMQPQueue._read_from_queue, which will sleep only when there is no data and return immediately when data is available.

This change makes the example script's throughput rise to ~700 msgs/s on my machine.