mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #20505: Remove resolution and _granularity from selectors and asyncio
* Remove selectors.BaseSelector.resolution attribute * Remove asyncio.BaseEventLoop._granularity attribute
This commit is contained in:
parent
c489e83432
commit
85310a50a9
9 changed files with 10 additions and 74 deletions
|
@ -83,11 +83,6 @@ class BaseSelector(metaclass=ABCMeta):
|
|||
performant implementation on the current platform.
|
||||
"""
|
||||
|
||||
@abstractproperty
|
||||
def resolution(self):
|
||||
"""Resolution of the selector in seconds"""
|
||||
return None
|
||||
|
||||
@abstractmethod
|
||||
def register(self, fileobj, events, data=None):
|
||||
"""Register a file object.
|
||||
|
@ -289,10 +284,6 @@ class SelectSelector(_BaseSelectorImpl):
|
|||
self._readers = set()
|
||||
self._writers = set()
|
||||
|
||||
@property
|
||||
def resolution(self):
|
||||
return 1e-6
|
||||
|
||||
def register(self, fileobj, events, data=None):
|
||||
key = super().register(fileobj, events, data)
|
||||
if events & EVENT_READ:
|
||||
|
@ -345,10 +336,6 @@ if hasattr(select, 'poll'):
|
|||
super().__init__()
|
||||
self._poll = select.poll()
|
||||
|
||||
@property
|
||||
def resolution(self):
|
||||
return 1e-3
|
||||
|
||||
def register(self, fileobj, events, data=None):
|
||||
key = super().register(fileobj, events, data)
|
||||
poll_events = 0
|
||||
|
@ -400,10 +387,6 @@ if hasattr(select, 'epoll'):
|
|||
super().__init__()
|
||||
self._epoll = select.epoll()
|
||||
|
||||
@property
|
||||
def resolution(self):
|
||||
return 1e-3
|
||||
|
||||
def fileno(self):
|
||||
return self._epoll.fileno()
|
||||
|
||||
|
@ -468,10 +451,6 @@ if hasattr(select, 'kqueue'):
|
|||
super().__init__()
|
||||
self._kqueue = select.kqueue()
|
||||
|
||||
@property
|
||||
def resolution(self):
|
||||
return 1e-9
|
||||
|
||||
def fileno(self):
|
||||
return self._kqueue.fileno()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue