Refactor arguments of run function

This commit is contained in:
38elements 2016-12-24 22:49:48 +09:00
parent 39211f8fbd
commit 2d05243c4a

View File

@ -230,15 +230,14 @@ class Sanic:
# Execution
# -------------------------------------------------------------------- #
def run(self, host="127.0.0.1", port=8000, protocol=HttpProtocol,
debug=False, before_start=None, after_start=None, before_stop=None,
after_stop=None, sock=None, workers=1, loop=None):
def run(self, host="127.0.0.1", port=8000, debug=False, before_start=None,
after_start=None, before_stop=None, after_stop=None, sock=None,
workers=1, loop=None, protocol=HttpProtocol):
"""
Runs the HTTP Server and listens until keyboard interrupt or term
signal. On termination, drains connections before closing.
:param host: Address to host on
:param port: Port to host on
:param protocol: Subclass of asyncio.Protocol
:param debug: Enables debug output (slows server)
:param before_start: Function to be executed before the server starts
accepting connections
@ -252,6 +251,7 @@ class Sanic:
:param workers: Number of processes
received before it is respected
:param loop: asyncio compatible event loop
:param protocol: Subclass of asyncio.Protocol
:return: Nothing
"""
self.error_handler.debug = True