[zeromq-dev] Tornado loops
Daniel Truemper
truemped at googlemail.com
Thu Jan 13 15:11:44 CET 2011
Whomever might interest this: a little gist on using the pyzmq eventloop with Tornado's AsyncHTTPClient:
https://gist.github.com/777893
The idea is the following:
- a Master PUSHes URLs
- a Downlaoder receives events using the ZMQStream
- download the URL using Tornado's AsyncHTTPClient
- once downloaded, PUBlish the interesting data
- the Master SUBscribes to that and does even more interesting stuff with all the data
The Message architecture is somewhat similar to what Mongrel2 does.
Any comments?
Best
Daniel
Am 12.01.2011 um 23:00 schrieb Daniel Truemper:
>
>> The ioloop.py in zmq.eventloop is a full replacement for the ioloop.py
>> in tornado that adds support for zmq sockets.. You just want one of
>> these and to use both tcp and zmq sockets you will have to use
>> zmq.eventloop.ioloop. But, once you start that event loop, you should
>> just be able to use the rest of tornado just like normal. Let us know
>> if you have problems. We should probably add an example to pyzmq that
>> shows how to do this.
> This is great news! I will try to construct a little example using Tornados httpclient.AsyncHTTPClient() tomorrow!
>
> Best
> Daniel
More information about the zeromq-dev
mailing list