selectors.EpollSelector

class selectors.EpollSelector select.epoll()-based selector. fileno() This returns the file descriptor used by the underlying select.epoll() object.

selectors.DevpollSelector.fileno()

fileno() This returns the file descriptor used by the underlying select.devpoll() object.

selectors.DevpollSelector

class selectors.DevpollSelector select.devpoll()-based selector. fileno() This returns the file descriptor used by the underlying select.devpoll() object. New in version 3.5.

selectors.DefaultSelector

class selectors.DefaultSelector The default selector class, using the most efficient implementation available on the current platform. This should be the default choice for most users.

selectors.BaseSelector.unregister()

abstractmethod unregister(fileobj) Unregister a file object from selection, removing it from monitoring. A file object shall be unregistered prior to being closed. fileobj must be a file object previously registered. This returns the associated SelectorKey instance, or raises a KeyError if fileobj is not registered. It will raise ValueError if fileobj is invalid (e.g. it has no fileno() method or its fileno() method has an invalid return value).

selectors.BaseSelector.select()

abstractmethod select(timeout=None) Wait until some registered file objects become ready, or the timeout expires. If timeout > 0, this specifies the maximum wait time, in seconds. If timeout <= 0, the call won’t block, and will report the currently ready file objects. If timeout is None, the call will block until a monitored file object becomes ready. This returns a list of (key, events) tuples, one for each ready file object. key is the SelectorKey instance corresponding to a ready fi

selectors.BaseSelector.register()

abstractmethod register(fileobj, events, data=None) Register a file object for selection, monitoring it for I/O events. fileobj is the file object to monitor. It may either be an integer file descriptor or an object with a fileno() method. events is a bitwise mask of events to monitor. data is an opaque object. This returns a new SelectorKey instance, or raises a ValueError in case of invalid event mask or file descriptor, or KeyError if the file object is already registered.

selectors.BaseSelector.modify()

modify(fileobj, events, data=None) Change a registered file object’s monitored events or attached data. This is equivalent to BaseSelector.unregister(fileobj)() followed by BaseSelector.register(fileobj, events, data)(), except that it can be implemented more efficiently. This returns a new SelectorKey instance, or raises a ValueError in case of invalid event mask or file descriptor, or KeyError if the file object is not registered.

selectors.BaseSelector.get_map()

abstractmethod get_map() Return a mapping of file objects to selector keys. This returns a Mapping instance mapping registered file objects to their associated SelectorKey instance.

selectors.BaseSelector.get_key()

get_key(fileobj) Return the key associated with a registered file object. This returns the SelectorKey instance associated to this file object, or raises KeyError if the file object is not registered.