]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-32309: Implement asyncio.to_thread() (GH-20143)
authorKyle Stanley <aeros167@gmail.com>
Tue, 19 May 2020 03:03:28 +0000 (23:03 -0400)
committerGitHub <noreply@github.com>
Tue, 19 May 2020 03:03:28 +0000 (20:03 -0700)
commitcc2bbc2227c3f5ed9d8f6b3bd052e6f9e68279d2
tree84839ab8dd6cc9969c3bb7516e20715a8273fb33
parentd4fe098d1ee4f4056ac65cae55f5ffdd439dede0
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/18410#issuecomment-628930973) in GH-18410 for context.

Automerge-Triggered-By: @aeros
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]