module wsgiex 0.2.1
Description ¶
This package provide extended versions of StreamServer, WSGIRequestHandler and some additions.
It doesn't has any dependences and use some parts of Werkzeug's source.
class WSGIRequestHandlerEx()
¶
Description ¶
Extended implementation of WSGIRequestHandler, that also use some code from Werkzeug.
Return ¶
instance
Instance of class WSGIRequestHandlerEx method_public connection_dropped(self, error, environ=None)
¶
Description ¶
Called if the connection was closed by the client. By default nothing happens.
method_public log_message(self, format, *args)
¶
Description ¶
# def log_error(self, format, *args): pass
# def log_request(self, format, *args): pass
class ThreadedStreamServerEx(self, bind_addr, RequestHandlerClass=None, bind_and_activate=True, dispatcher=None, socketClass=None, selectClass=None, eventClass=None, ssl_args=None, log=True, request_queue_size=None, spawnThreadFunc=None, killThreadFunc=None, sleepFunc=None)
¶
Description ¶
Multi-threaded version of StreamServerEx, that use pool and allow to kill spawned threads.
It also can be patched for using something, that emulate threads by passing <spawnThreadFunc>, <killThreadFunc> and <sleepFunc>.
Return ¶
instance
Instance of class ThreadedStreamServerEx method_public handle_request(self)
¶
Description ¶
Handle one request, possibly blocking. Respects self.timeout.
method_public process_request(self, request, client_address)
¶
Description ¶
Start a new thread to process the request.
method_public process_request_thread(self, rId, request, client_address)
¶
Description ¶
Same as in BaseServer but as a thread. In addition, exception handling is done here.
method_special __del__(self)
¶
method_special __init__(self, bind_addr, RequestHandlerClass=None, bind_and_activate=True, dispatcher=None, socketClass=None, selectClass=None, eventClass=None, ssl_args=None, log=True, request_queue_size=None, spawnThreadFunc=None, killThreadFunc=None, sleepFunc=None)
¶
class StreamServerEx(self, bind_addr, RequestHandlerClass=None, bind_and_activate=True, dispatcher=None, socketClass=None, selectClass=None, eventClass=None, ssl_args=None, log=True, request_queue_size=None)
¶
Description ¶
Extended impelementation of standart Python BaseHTTPServer.HTTPServer, that supports UnixDomainSockets and passed sockets. It also supports SSL and overloading Socket's class and Select's class (for simple using with gevent, for example) by passing <socketClass>, <selectClass>, <eventClass>.
Return ¶
instance
Instance of class StreamServerEx