gevent.select – Waiting for I/O completion¶
Waiting for I/O completion.
- class poll[source]¶
- Bases: - object- An implementation of - select.pollthat blocks only the current greenlet.- With only one exception, the interface is the same as the standard library interface. - Caution - POLLPRIdata is not supported.- Added in version 1.1b1. - Changed in version 1.5: This is now always defined, regardless of whether the standard library defines - select.poll()or not. Note that it may have different performance characteristics.- poll(timeout=None)[source]¶
- poll the registered fds. - Changed in version 1.2a1: File descriptors that are closed are reported with POLLNVAL. - Changed in version 1.3a2: Under libuv, interpret timeout values less than 0 the same as None, i.e., block. This was always the case with libev. 
 - register(fd, eventmask=<default value>)[source]¶
- Register a file descriptor fd with the polling object. - Future calls to the - poll`()method will then check whether the file descriptor has any pending I/O events. fd can be either an integer, or an object with a- fileno()method that returns an integer. File objects implement- fileno(), so they can also be used as the argument (but remember that regular files are usually always ready).- eventmask is an optional bitmask describing the type of events you want to check for, and can be a combination of the constants - POLLIN, and- POLLOUT(- POLLPRIis not supported).
 
- select(rlist, wlist, xlist, timeout=None)[source]¶
- An implementation of - select.selectthat blocks only the current greenlet.- Caution - xlist is ignored. - Changed in version 1.2a1: Raise a - ValueErrorif timeout is negative. This matches Python 3’s behaviour (Python 2 would raise a- select.error). Previously gevent had undefined behaviour.- Changed in version 1.2a1: Raise an exception if any of the file descriptors are invalid.