Issue #20311: asyncio: Add a granularity attribute to BaseEventLoop: maximum

between the resolution of the BaseEventLoop.time() method and the resolution of
the selector. The granuarility is used in the scheduler to round time and
deadline.
This commit is contained in:
Victor Stinner 2014-01-25 15:01:33 +01:00
parent 635fca9704
commit f67255ab94
6 changed files with 44 additions and 1 deletions

View file

@ -34,6 +34,7 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop):
selector = selectors.DefaultSelector()
logger.debug('Using selector: %s', selector.__class__.__name__)
self._selector = selector
self.granularity = max(selector.resolution, self.granularity)
self._make_self_pipe()
def _make_socket_transport(self, sock, protocol, waiter=None, *,