[rabbitmq-discuss] Adapter merges tornado and pika

majek04 majek04 at gmail.com
Fri Mar 26 11:45:08 GMT 2010


On Sat, Mar 20, 2010 at 14:06, 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.
>
> 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)

Thanks for that. It looks very interesting. We definitely need to find a way
how to use AMQP in async web servers.

Although, I'd think it would be better to move Pika to Tornado async
adapter rather than moving Tornado to Asyncore. Do you think it's sensible?

Here's my attempt to replace Asyncore with Select for pika:
http://github.com/majek/pika/blob/master/pika/poll_adapter.py

I noticed a strange thing in the code, why do you import py-amqplib in
frontend.py#16?

Marek Majkowski




More information about the rabbitmq-discuss mailing list