summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/selector_events.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-01-25 14:01:33 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-01-25 14:01:33 (GMT)
commitf67255ab94742b017697bdedfd4c8eb25dac6f82 (patch)
tree391dc1e1c5a305ae4cc9bccec135a9bb6206e37f /Lib/asyncio/selector_events.py
parent635fca9704b102a97233a3af18231a7b649d0169 (diff)
downloadcpython-f67255ab94742b017697bdedfd4c8eb25dac6f82.zip
cpython-f67255ab94742b017697bdedfd4c8eb25dac6f82.tar.gz
cpython-f67255ab94742b017697bdedfd4c8eb25dac6f82.tar.bz2
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.
Diffstat (limited to 'Lib/asyncio/selector_events.py')
-rw-r--r--Lib/asyncio/selector_events.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py
index 19caf79..d2b3ccc 100644
--- a/Lib/asyncio/selector_events.py
+++ b/Lib/asyncio/selector_events.py
@@ -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, *,