def http(tasks, bind):
"""Http interface using built-in simple wsgi server"""
from wsgiref.simple_server import make_server
from .utils import load_manager
from .http import Application
host, _, port = bind.partition(':')
app = Application(load_manager(tasks))
httpd = make_server(host, int(port), app)
print('Listen on {}:{} ...'.format(host or '0.0.0.0', port), file=sys.stderr)
httpd.serve_forever()
评论列表
文章目录