fix run_async demo

This commit is contained in:
Fengyuan Chen
2017-02-04 15:27:46 +08:00
parent 6f0b09509e
commit 884749f345
2 changed files with 6 additions and 3 deletions

View File

@@ -297,8 +297,9 @@ def serve(host, port, request_handler, error_handler, before_start=None,
:param protocol: Subclass of asyncio protocol class
:return: Nothing
"""
loop = async_loop.new_event_loop()
asyncio.set_event_loop(loop)
if not run_async:
loop = async_loop.new_event_loop()
asyncio.set_event_loop(loop)
if debug:
loop.set_debug(debug)