Closed erikyao closed 1 year ago
Python 3.10 asyncio syntax and API should be applied across the myvariant.info code base. Specifically:
@asyncio.coroutine
async def
await
yield from
asyncio.create_task()
asyncio.ensure_future()
Note that Goal 3 could be tricky because if a corotine is to be executed in another thread (e.g. the corotine JobManager.defer_to_thread()), asyncio.run_coroutine_threadsafe() should be used. See https://docs.python.org/3/library/asyncio-dev.html#concurrency-and-multithreading
JobManager.defer_to_thread()
asyncio.run_coroutine_threadsafe()
Fixes will be pushed to branch py3.10_asyncio_pymongo4
Fixed with PR https://github.com/biothings/myvariant.info/pull/157
Python 3.10 asyncio syntax and API should be applied across the myvariant.info code base. Specifically:
@asyncio.coroutine
annotations; useasync def
to define a corotineawait
instead ofyield from
to consume a corotineasyncio.create_task()
instead ofasyncio.ensure_future()
to schedule a task (which wraps a corotine).Note that Goal 3 could be tricky because if a corotine is to be executed in another thread (e.g. the corotine
JobManager.defer_to_thread()
),asyncio.run_coroutine_threadsafe()
should be used. See https://docs.python.org/3/library/asyncio-dev.html#concurrency-and-multithreadingFixes will be pushed to branch py3.10_asyncio_pymongo4