use asyncio.ensure_future to start coroutines immediately

asyncio has different coroutine start mechanics than tornado

tornado starts coroutines immediately,
whereas asyncio doesn't until they are scheduled with either ensure_future or waited upon.
This commit is contained in:
Min RK
2018-03-01 17:41:51 +01:00
parent b6f634368c
commit 97293ab7ce
2 changed files with 5 additions and 4 deletions

View File

@@ -385,7 +385,7 @@ class User:
try:
# run optional preparation work to bootstrap the notebook
await awaitable(spawner.run_pre_spawn_hook())
f = spawner.start()
f = awaitable(spawner.start())
# commit any changes in spawner.start (always commit db changes before yield)
db.commit()
ip_port = await gen.with_timeout(timedelta(seconds=spawner.start_timeout), f)