def wsgi(
self,
port=None,
host=None,
max_accept=settings.GEVENT_MAX_CONNECTIONS,
min_delay=0.1,
max_delay=1,
stop_timeout=1):
if isinstance(port, int):
self.port = port
if isinstance(host, basestring):
self.host = host
wsgi_params = dict(
max_accept=max_accept,
min_delay=min_delay,
max_delay=max_delay,
stop_timeout=stop_timeout,
get_url=lambda s: self.get_url()
)
StandaloneServer = type(
'StandaloneServer', (WSGIServer, ), wsgi_params)
return StandaloneServer((self.host, self.port), self)
评论列表
文章目录