Skip to content

bpo-37088: Add the sys.addpendingcall() function. #13656

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

Closed
wants to merge 1 commit into from

Conversation

1st1
Copy link
Member

@1st1 1st1 commented May 29, 2019

Copy link
Contributor

@asvetlov asvetlov left a comment

Choose a reason for hiding this comment

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

I like it but we need more reviewers I guess

@asvetlov
Copy link
Contributor

@vstinner what do you think?

Copy link
Contributor

@asvetlov asvetlov left a comment

Choose a reason for hiding this comment

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

The more I think the more I like it.
addpendingcall() is obviously the very low-level API but it can help asyncio a lot for initialization event loop policies and SIGCHLD handling on Linux.
Python allows subscribing on a signal from the main thread only.
asyncio has on-demand initialization strategy for loops and policies.
So, if I want to use asyncio from sub-thread only and want to execute subprocesses a way to execute some code in main thread if I'm now in sub-thread context the feature is pretty cool.

@csabella
Copy link
Contributor

csabella commented Feb 7, 2020

This looked like it was ready to be merged, maybe pending some comments from the bug tracker. @1st1, what do you think?

@asvetlov
Copy link
Contributor

asvetlov commented Feb 7, 2020

@vstinner had objections, perhaps this PR should be rejected.

@vstinner
Copy link
Member

vstinner commented Feb 7, 2020

There is not clear rationale to justify the additon of the function, so I reject the feature. If you are still interesting by the function, please elaborate the rationale in https://bugs.python.org/issue37088

@vstinner vstinner closed this Feb 7, 2020
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.

6 participants