-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
bpo-44951: Allow setting EPOLLEXCLUSIVE on selectors.EpollSelector #27819
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
base: main
Are you sure you want to change the base?
Conversation
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). CLA MissingOur records indicate the following people have not signed the CLA: For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. If you have recently signed the CLA, please wait at least one business day You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
8601851
to
7e54752
Compare
@@ -349,15 +349,16 @@ def __init__(self): | |||
super().__init__() | |||
self._selector = self._selector_cls() | |||
|
|||
def register(self, fileobj, events, data=None): | |||
def register(self, fileobj, events, data=None, register_flags=None): |
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 this is in a method literally called register
, I'd name the new argument simply flags
.
def exclusive(self): | ||
return self._exclusive | ||
|
||
def set_exclusive(self, value): |
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.
So far selectors
haven't had this but looking at asyncio
, ssl
, socket
, threading
, and multiprocessing
code, we usually either use properties for both getting and setting a value, or we use both a get_*
and a set_*
method.
Since we already have get_key
and get_map
in selectors.py
, and there are no public fields nor properties here, I'd change the exclusive
getter to an explicit get_exclusive()
method.
Thanks for the feedback - I think it is best to get a decision made on whether this approach is the way to go (modify the Epoll class) or if it should be an entirely new EpollExclusiveSelector class with no API changes. |
The latest mailing list post on this issue, summarizing the two approaches and the decision that should be made, is here https://mail.python.org/archives/list/python-dev@python.org/thread/VB2BBUUJENMWPGXGFMON7UQW27ZOBIB7/ |
The following commit authors need to sign the Contributor License Agreement: |
See:
https://bugs.python.org/issue44951
https://bugs.python.org/issue35517
#11193
https://bugs.python.org/issue44951