Asynchronous HTTP server in standard library ?

Pierre Quentel quentel.pierre at wanadoo.fr
Sat Jan 10 14:25:46 CET 2004


Python standard library provides two modules for asynchronous socket
programming : asyncore and asynchat. Several web servers have been built
upon these modules (medusa being the best-known I suppose) and are famous
for their performance level

Unfortunately no example of use is provided in the standard library (whereas
the more "classic" SocketServer is illustrated by BaseHTTPServer,
SimpleHTTPServer, etc). I think it would be useful if Python came with a
simple HTTP server written with these modules, to help beginners understand
how use them

I've written one, which handles GET and POST requests. It's inspired by (and
partly copied from) the http subset of medusa, only reduced to less than 200
lines. It's called SimpleAsyncHTTPServer and published on Active State
Python Cookbook
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/259148

Any thoughts ?
Pierre





More information about the Python-list mailing list