Commit 6a101b46 authored by Denis Bilenko's avatar Denis Bilenko

Timeout: use ref=False when creating a timer

parent 598c3787
......@@ -86,10 +86,9 @@ class Timeout(BaseException):
def __init__(self, seconds=None, exception=None):
self.seconds = seconds
self.exception = exception
if seconds is not None:
self.timer = get_hub().loop.timer(seconds)
else:
self.timer = get_hub().loop.timer(0.0)
self.timer = get_hub().loop.timer(seconds or 0.0, ref=False)
# we pass ref=False so that gevent.run() ignores oustanding timeouts
# we can do that because timeouts are always used with some other watchers
def start(self):
"""Schedule the timeout."""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment