In a recent experiment I've done this:

from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from wsgiref.simple_server import make_server, demo_app
from SocketServer import ThreadingMixIn

# Let's make a WSGI server that can use multiple threads.

class ThreadedHTTPServer(ThreadingMixIn, HTTPServer):
    """Handle requests in a separate thread."""

# Evil! ;-)
from wsgiref.simple_server import WSGIServer as MyWSGIServer
MyWSGIServer.__bases__ = (ThreadedHTTPServer,)

Now I wonder if there's a less evil way that does not involve copy & paste of the WSGIServer code (only couple of lines, but I hate duplication)?!

-- Gerhard

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to