[rabbitmq-discuss] Adapter merges tornado and pika
Jason J. W. Williams
jasonjwwilliams at gmail.com
Fri Mar 26 16:55:08 GMT 2010
I haven't spent much time looking at Tornado yet, but is the txAMQP
library portable since it's already async (Twisted)?
-J
On Sat, Mar 20, 2010 at 8:06 AM, Richard Clark <richard at redspider.co.nz> wrote:
> Ok, I'm half asleep so I'll make this quick. After fighting with
> numerous strategies for melding tornado and rabbitmq in a way that
> doesn't involve spawning extra processes, mangling my interpreter,
> going anywhere near twisted, mangling my ability to dispatch properly
> off multiple queues on a single channel etc, I finally managed
> something that, at least for first appearances, works.
>
> The changes are fairly simple. Tornado needs one 2 line change to
> ioloop to allow it to run a loop once, rather than spinning - sadly
> attempts to do it without this change caused nightmarish bugs to
> emerge.
>
> In addition to that, two files (attached, no warranty etc etc) are
> required:
>
> asyncloop.py, an ioloop handler that mostly pretends to be an asyncore
> dispatcher
> ioloop_adapter.py, an adapter almost exactly like the
> asyncore_adapter.py in pika, except it uses the asyncloop and gets rid
> of some crap (and, unfortunately, timers, but they're easy to put back
> using ioloop stuff)
>
> In no way is this production code, it's barely even tested. I intend
> to try and get it further in that direction tomorrow, but in case
> anyone else has been banging their head on the same problem I figured
> I'd throw the strategy out there.
>
> Files:
> http://gist.github.com/338680
>
> Example:
> http://gist.github.com/338683 (requires an amqp echo service on echo/
> echo)
>
> cross-posting to tornado as well.
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
More information about the rabbitmq-discuss
mailing list