multitask http server (single-process multi-connection HTTP server)

lkcl luke.leighton at gmail.com
Mon Jul 12 16:59:09 EDT 2010


for several reasons, i'm doing a cooperative multi-tasking HTTP
server:
  git clone git://pyjs.org/git/multitaskhttpd.git

there probably exist perfectly good web frameworks that are capable of
doing this sort of thing: i feel certain that twisted is one of them.
however, the original author of rtmplite decided to rip twisted out
and to use multitask.py and i'm one of those strange people that also
likes the idea of using 900 lines of awesome elegant code rather than
tens of thousands of constantly-moving-target.

one of the things that's slightly unfortunate is that i'm going to
have to copy SimpleHTTPServer.py and slightly modify it;
CGIHTTPServer.py as well.  this is Generally Bad Practice.

can anyone think of a way of monkey-patching or otherwise using
SimpleHTTPRequestHandler and CGIHTTPRequestHandler and overriding the
base class from which those two are derived?

i have had to pull bits out of BaseHTTPRequestHandler to make them use
the "yield" logic of multitask.py already, which was painful enough.

ideas, anyone?

l.



More information about the Python-list mailing list