Diesel: How Python Does Comet
- async I/O using epoll on Linux - for Python 2.6 - uses Python's generators - is not Twisted nor a twister or a Tornado
Let me be the first to get out of the way all of the complaints:
1. Why didn't they just use Twisted? 2. Why didn't they predict tornado and make it better? 3. Yeah, but (tornado|twisted|my half baked implementation) is still faster at serving 'hello world' than diesel.
---
I for one welcome this new breed of choice in this space. I'm interested in "real-timing" an application I'm currently working on, so having more choices as to which way to implement it is great.
Interesting, this is the first Python async/comet library I've seen to take advantage of generator coroutines:
def echo(remote_addr): their_message = yield until_eol() yield "you said: %s\r\n" % their_message.strip()When I think of "comet" I think of "something that gives my apps the ability 'push' to browsers [even if it's really long polling under the hood]." Did I miss the browser integration story here, or are we calling all asynchronous apis "comet" now?
I just think it's funny how they compare it to the 1 week old tornado rather than twisted. Way to jump on the bandwagon. I predict a few more asynch libraries going open source in the not so distant future.
It does seem a bit messy to read, at least compared to eventlet/gevent which does some nice monkey-patching of the socket API.
When will people start to understand that req/s is not the full picture of how well a Comet webserver scales :/