Async WSGI under tornado

39 views
Skip to first unread message

JKP

unread,
Nov 22, 2009, 9:05:05 AM11/22/09
to Tornado Web Server
Hi all

I recently stumbled upon Tornado when I found an integration that had
been created with the Cappuccino framework which illustrated the use
of Tornado to achieve a long-polling effect:
http://github.com/eliasklughammer/Cappuccino-X-Tornado.

I wanted similar functionality for an application I'm building and I
really liked the look of Tornado once I started looking at it. The
only drawback is that whilst I can integrate WSGI applications using
the provided adapter, I'm not then able to use the async goodness that
makes the long-polling implementation possible.

Anyway, I then started hunting around for async WSGI implementations,
of which there are a few floating around on the web. I stumbled upon
the "spawning" webserver, which looked like it might be what I was
after, but having looked at the code and played with it a bit I
decided it was no where near as clean as Tornado was (prints all over
the place for example).

Seeing the code gave me some ideas however, and having played around
for a few hours this evening I came up with some experimental code
that allows some async behaviour to be added to WSGI handlers running
under tornado: http://gist.github.com/240571.

The code is pretty crude and has some glaring issues which would hit
should Tornado go multithreaded or multiprocess, but for simple cases
it works.

Anyway, thought someone else might find that useful so have posted it
to Github for anyone to use if they are interested.

Thanks for a great server, looking forward to the next release.

Jamie
Reply all
Reply to author
Forward
0 new messages