Refactor arguments of run function
This commit is contained in:
parent
39211f8fbd
commit
2d05243c4a
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user