From 65f0a05f2ac68a5f7466910f09d0abb7a7f4019a Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 20 Apr 2014 06:01:04 +0300 Subject: [PATCH] asyncio: EpollEventLoop.wait(): support infinite wait. --- asyncio/asyncio.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/asyncio/asyncio.py b/asyncio/asyncio.py index e5c174a5..238565cb 100644 --- a/asyncio/asyncio.py +++ b/asyncio/asyncio.py @@ -95,7 +95,11 @@ class EpollEventLoop(EventLoop): self.poller.register(fd, select.EPOLLOUT, (cb, args)) def wait(self, delay): - res = self.poller.poll(int(delay * 1000)) + print("epoll.wait", delay) + if delay == -1: + res = self.poller.poll(-1) + else: + res = self.poller.poll(int(delay * 1000)) print("poll: ", res) for cb, ev in res: cb[0](*cb[1])