Merge pull request #369 from r0fls/fix-async-run

fix async run, add tests
This commit is contained in:
Eli Uriegas
2017-01-30 22:21:25 -06:00
committed by GitHub
4 changed files with 46 additions and 1 deletions

View File

@@ -297,7 +297,8 @@ 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()
loop = loop or async_loop.new_event_loop()
asyncio.set_event_loop_policy(async_loop.EventLoopPolicy())
asyncio.set_event_loop(loop)
if debug: