Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-32309: Add support for contextvars in asyncio.to_thread() #20278

Merged
merged 2 commits into from
May 21, 2020

Conversation

aeros
Copy link
Contributor

@aeros aeros commented May 21, 2020

Allows contextvars from the main thread to be accessed in the separate thread used in asyncio.to_thread(). See the discussion in GH-20143 for context.

https://bugs.python.org/issue32309

Automerge-Triggered-By: @aeros

* Also, adds missing versionadded in the documentation

Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
@aeros
Copy link
Contributor Author

aeros commented May 21, 2020

Skipping the news entry since this is effectively just a small revision to GH-20143.

/cc @1st1

Copy link
Member

@1st1 1st1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, don't forget to backport to 3.9

Co-authored-by: Yury Selivanov <yury@edgedb.com>
@miss-islington
Copy link
Contributor

@aeros: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit 0f56263 into python:master May 21, 2020
@miss-islington
Copy link
Contributor

Thanks @aeros for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 21, 2020
…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/20143GH-discussion_r427808225) in pythonGH-20143 for context.

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

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label May 21, 2020
@bedevere-bot
Copy link

GH-20279 is a backport of this pull request to the 3.9 branch.

miss-islington added a commit that referenced this pull request May 21, 2020
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/20143GH-discussion_r427808225) in GH-20143 for context.

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

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
arturoescaip pushed a commit to arturoescaip/cpython that referenced this pull request May 24, 2020
…GH-20278)

Allows contextvars from the main thread to be accessed in the separate thread used in `asyncio.to_thread()`. See the [discussion](python#20143 (comment)) in pythonGH-20143 for context.

Automerge-Triggered-By: @aeros
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants