]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-32309: Implement asyncio.to_thread() (GH-20143)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 19 May 2020 10:03:25 +0000 (03:03 -0700)
committerGitHub <noreply@github.com>
Tue, 19 May 2020 10:03:25 +0000 (03:03 -0700)
commite2991308c9b49547d9762157ac913dda94b5eb32
treead5481c656f898ca794fe62ab882d95c2388b65f
parent3d062829deadcb8355e97090aba47138eb9bc649
bpo-32309: Implement asyncio.to_thread() (GH-20143)

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](https://github.com/python/cpython/pull/18410GH-issuecomment-628930973) in GH-18410 for context.

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

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
Doc/library/asyncio-api-index.rst
Doc/library/asyncio-task.rst
Doc/whatsnew/3.9.rst
Lib/asyncio/__init__.py
Lib/asyncio/threads.py [new file with mode: 0644]
Lib/test/test_asyncio/test_threads.py [new file with mode: 0644]
Misc/NEWS.d/next/Library/2020-05-17-02-03-09.bpo-32309.KM9psl.rst [new file with mode: 0644]