[3.9] bpo-32309: Implement asyncio.to_thread() (GH-20143) by miss-islington · Pull Request #20212 · python/cpython (original) (raw)

Implements asyncio.to_thread, a coroutine for asynchronously running IO-bound functions in a separate thread without blocking the event loop. See the discussion starting from here in GH-18410 for context.

Automerge-Triggered-By: @aeros
(cherry picked from commit cc2bbc2)

Co-authored-by: Kyle Stanley aeros167@gmail.com

https://bugs.python.org/issue32309