]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-32309: Add support for contextvars in asyncio.to_thread() (GH-20278)
authorKyle Stanley <aeros167@gmail.com>
Thu, 21 May 2020 05:20:43 +0000 (01:20 -0400)
committerGitHub <noreply@github.com>
Thu, 21 May 2020 05:20:43 +0000 (22:20 -0700)
commit0f56263e62ba91d0baae40fb98947a3a98034a73
tree54ead06a73b5ff9b9603c3d19bf39732401280c8
parent7efb826c3e54edf10315e4baf5e96fe9a3729da4
bpo-32309: Add support for contextvars in asyncio.to_thread() (GH-20278)

Allows contextvars from the main thread to be accessed in the separate thread used in `asyncio.to_thread()`. See the [discussion](https://github.com/python/cpython/pull/20143#discussion_r427808225) in GH-20143 for context.

Automerge-Triggered-By: @aeros
Doc/library/asyncio-task.rst
Lib/asyncio/threads.py
Lib/test/test_asyncio/test_threads.py