[issue20311] epoll.poll(timeout) and PollSelector.select(timeout) must round the timeout to the upper bound

STINNER Victor report at bugs.python.org
Sat Jan 25 15:44:28 CET 2014


STINNER Victor added the comment:

I revert all changes in select an selectors, the timeout is rounded again towards zero, as it was before.

I applied my asyncio_granularity.patch:
- selectors.BaseSelector has a new abstract "resolution" property
- asyncio.BaseEventLoop has a new granularity attribute which is used in _run_once() to round timings

I don't like hurry to push changes without review, but I wanted to revert my changes on select and selectors and fix the issue in asyncio issue before Python 3.4 beta 3.

I'm now waiting for buildbots. Don't hesitate to review my changes on selectors (new resolution attribute) and asyncio (new granularity attribute).

For selectors, I chose an abstract attribute to ensure that the resolution is defined in subclasses of BaseSelector and because it does not make sense to modify the resolution.

For asyncio, it's a classic attribute because a subclass may want to adjust the granularity if it overrides the time() method, or for other reasons.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20311>
_______________________________________


More information about the Python-bugs-list mailing list