-
-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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-30300: A convenient "controller" for asyncio-based servers #1492
Conversation
@warsaw, thanks for your PR! By analyzing the history of the files in this pull request, we identified @terryjreedy, @birkenfeld and @eliben to be potential reviewers. |
Lib/asyncio/controller.py
Outdated
try: | ||
from socket import socketpair | ||
except ImportError: | ||
from asyncio.windows_utils import socketpair |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No more needed in Python 3.7, just remove it. But i don't know if Controller would only go to asyncio of Python 3.7?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's only needed in Python <= 3.4, I'll remove it. Even if it's needed in other places, I don't care about 3.4 any more.
Lib/asyncio/controller.py
Outdated
self.ready_timeout = ready_timeout if envar is None else float(envar) | ||
# For exiting the loop. | ||
self._rsock, self._wsock = socketpair() | ||
self.loop.add_reader(self._rsock, self._reader) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that a socketpair is really needed here. Why not simply using call_soon_threadsafe() from stop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think that's better. Thanks!
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. Thanks again to your contribution and we look forward to looking at it! |
Something seems wrong. The IDLE patches have already been merged into cpython/master. |
Yikes, something definitely must have gone wrong with the merge of master. |
Obviously, I've signed the CLA. |
This change comes from discussions on python/cpython#1492
I think a rebase and force-push is in order at this point; the actual change is drowned out by changes that GitHub shouldn't be showing on the |
@zware Yep. rebase & force pushed. |
Close the PR as https://bugs.python.org/issue30300 was rejected |
@asvetlov Sorry for the noise, I failed to check the issue. |
No problem |
This is refactored out of aiosmtpd and made generic.
https://bugs.python.org/issue30300