Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bpo-34014: Added support of contextvars for BaseEventLoop.run_in_executor#9688

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
hellysmile wants to merge8 commits intopython:mainfromhellysmile:bpo-34014

Conversation

@hellysmile
Copy link
Contributor

@hellysmilehellysmile commentedOct 3, 2018
edited by bedevere-bot
Loading

An updated version of#8035

according to latest discussion onhttps://bugs.python.org/issue34014

If proposed solution looks good I'll start updating related docs changes

https://bugs.python.org/issue34014

hyzyla reacted with thumbs up emoji
Copy link
Member

@1st11st1 left a comment

Choose a reason for hiding this comment

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

[Blocking this to prevent accidental merge.]

As per the bpo discussion: our goal is to provide a new API for working with threadpools and processpools. If we end up having their design ready in a few months we might want to revisit this PR. If not, we'll likely merge this PR as is.

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phraseI have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@hellysmile
Copy link
ContributorAuthor

@1st1 thanks for the update!

Is there any PEP/API spec/ideas available?

@csabellacsabella requested review from1st1 andasvetlov and removed request forasvetlovMay 31, 2019 11:36
@hellysmile
Copy link
ContributorAuthor

master was just merged

@hellysmile
Copy link
ContributorAuthor

I have made the requested changes; please review again.

@bedevere-bot
Copy link

Thanks for making the requested changes!

@1st1: please review the changes made to this pull request.

@1st1
Copy link
Member

I'm still not sure about this -- we can't make contextvars work with process pools. :( Need to design a new API for 3.9. You can champion that; first we need to start a discussion. We'll need to assess the current situation, what are the alternatives (curio, trio, twisted), and what's the best possible api we can design for asyncio given its constraints.

@hellysmile
Copy link
ContributorAuthor

hellysmile commentedOct 21, 2019
edited
Loading

@1st1 seems using something rather thanThreadPoolExecutor will be prohibited in3.9

https://github.com/python/cpython/blob/master/Lib/asyncio/base_events.py#L811

what about to restrict same way using notThreadPoolExecutor instances asexecutor argument inrun_in_executor

and silently apply propagation ofcontextvars

then we can point this changes toPython 3.9

@1st1
Copy link
Member

and silently apply propagation of contextvars

Yeah, that's another problem, as we didn't do so in 3.7/3.8.

@asvetlov what do you think?

@asvetlov
Copy link
Contributor

process pool executor is forbidden asdefault because things like DNS resolving doesn't work with it IIRC.
Passing explicit ProcessPoolExecutor intorun_in_executor() is still supported.

Sorry, I don't follow what the proposal is? Please elaboratesilently apply propagation of contextvars part

gjoseph92 added a commit to gjoseph92/distributed that referenced this pull requestOct 27, 2021
Helps with setting the current client in worker while deserializing. Implementation referenced frompython/cpython#9688
gjoseph92 added a commit to gjoseph92/distributed that referenced this pull requestNov 1, 2021
Helps with setting the current client in worker while deserializing. Implementation referenced frompython/cpython#9688
@NargiT
Copy link

any news about this ?

@NargiT
Copy link

@asvetlov is there an alternative to this ?

@asvetlov
Copy link
Contributor

@asvetlov is there an alternative to this ?

Take a look atasyncio.to_thread()

NargiT reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@1st11st1Awaiting requested review from 1st11st1 is a code owner

@asvetlovasvetlovAwaiting requested review from asvetlovasvetlov is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

7 participants

@hellysmile@bedevere-bot@1st1@asvetlov@NargiT@the-knights-who-say-ni@csabella

[8]ページ先頭

©2009-2025 Movatter.jp