[rabbitmq-discuss] Python example on event-driving consumer?

Aaron Westendorf aaron at agoragames.com
Mon Feb 6 14:27:56 GMT 2012

I hope improved documentation is coming soon but the gist here is that
a greenlet should loop over read_frames() and that will drive events.
The IO is blocking to let gevent do all the work of scheduling socket
operations. In most cases, I recommend spawning a new greenlet in a
consumer callback but YMMV.


On Sat, Feb 4, 2012 at 1:11 AM, Mark Wong-VanHaren <markwvh at gmail.com> wrote:
> Hi, Aaron-
> Haigha looks really cool, and I'm interested to use it with gevent.  Perhaps
> you could offer and example of how one does that?
> In your stress_test:
>     https://github.com/agoragames/haigha/blob/master/scripts/stress_test
> I see that you're continually calling connection.read_frames(), and I see a
> comment in the implementation of that method saying:
>   #  ....in the case of gevent, this is how a blocking call to
>   # read from the socket is kicked off.
> But I'm afraid I don't grok that or know what that means in terms of how one
> should use Haigha with gevent.
> Any help would be greatly appreciated.  Thanks!
> -Mark
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

Aaron Westendorf
Senior Software Engineer
Agora Games
359 Broadway
Troy, NY 12180
Phone: 518.268.1000
aaron at agoragames.com

More information about the rabbitmq-discuss mailing list