need manual stop

This commit is contained in:
Chih Cheng Liang 2019-11-11 22:52:48 +08:00 committed by mhchia
parent ed17bfd663
commit f5c725788e
No known key found for this signature in database
GPG Key ID: 389EFBEA1362589A

View File

@ -79,7 +79,10 @@ async def run(port: int, destination: str, localhost: bool) -> None:
async def async_main_wrapper(*args):
async with trio_asyncio.open_loop() as loop:
assert loop == asyncio.get_event_loop()
await run(*args)
stopped_event = trio.Event()
await trio_asyncio.run_asyncio(run, *args)
await stopped_event.wait()
def main() -> None:
description = """