Lines Matching refs:select
4 `select` module primitives.
12 import select
90 A selector can use various implementations (select(), poll(), epoll()...)
155 def select(self, timeout=None):
162 if timeout <= 0, the select() call won't block, and will
164 if timeout is None, select() will block until a monitored
314 r, w, x = select.select(r, w, w, timeout)
317 _select = select.select
319 def select(self, timeout=None):
402 def select(self, timeout=None):
431 if hasattr(select, 'poll'):
435 _selector_cls = select.poll
436 _EVENT_READ = select.POLLIN
437 _EVENT_WRITE = select.POLLOUT
440 if hasattr(select, 'epoll'):
444 _selector_cls = select.epoll
445 _EVENT_READ = select.EPOLLIN
446 _EVENT_WRITE = select.EPOLLOUT
451 def select(self, timeout=None):
462 # we want to make sure that `select()` can be called when no
473 if event & ~select.EPOLLIN:
475 if event & ~select.EPOLLOUT:
488 if hasattr(select, 'devpoll'):
492 _selector_cls = select.devpoll
493 _EVENT_READ = select.POLLIN
494 _EVENT_WRITE = select.POLLOUT
504 if hasattr(select, 'kqueue'):
511 self._selector = select.kqueue()
520 kev = select.kevent(key.fd, select.KQ_FILTER_READ,
521 select.KQ_EV_ADD)
524 kev = select.kevent(key.fd, select.KQ_FILTER_WRITE,
525 select.KQ_EV_ADD)
535 kev = select.kevent(key.fd, select.KQ_FILTER_READ,
536 select.KQ_EV_DELETE)
544 kev = select.kevent(key.fd, select.KQ_FILTER_WRITE,
545 select.KQ_EV_DELETE)
553 def select(self, timeout=None):
568 if flag == select.KQ_FILTER_READ:
570 if flag == select.KQ_FILTER_WRITE:
587 selector = getattr(select, method, None)
589 # select module does not implement method
607 # epoll|kqueue|devpoll > poll > select.
608 # select() also can't accept a FD > FD_SETSIZE (usually around 1024)