select: epoll.poll() takes timeout in seconds.

That's inconsistent with poll.poll(), but that's how CPython has it.
pull/216/head
Paul Sokolovsky 2017-10-21 00:40:50 +03:00
rodzic 61f9dd8721
commit c8f9cf1dca
1 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -71,7 +71,7 @@ class Epoll:
os.check_error(r)
del self.registry[fd]
def poll(self, timeout=-1):
def poll_ms(self, timeout=-1):
s = bytearray(self.evbuf)
while True:
n = epoll_wait(self.epfd, s, 1, timeout)
@ -84,6 +84,9 @@ class Epoll:
res.append((vals[1], vals[0]))
return res
def poll(self, timeout=-1):
return self.poll_ms(-1 if timeout == -1 else timeout * 1000)
def close(self):
os.close(self.epfd)