diff options
Diffstat (limited to 'Doc/library/select.rst')
-rw-r--r-- | Doc/library/select.rst | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/Doc/library/select.rst b/Doc/library/select.rst index b1fd3a8..524e411 100644 --- a/Doc/library/select.rst +++ b/Doc/library/select.rst @@ -14,6 +14,14 @@ it also works for other file types (in particular, on Unix, it works on pipes). It cannot be used on regular files to determine whether a file has grown since it was last read. +.. note:: + + The :mod:`selectors` module allows high-level and efficient I/O + multiplexing, built upon the :mod:`select` module primitives. Users are + encouraged to use the :mod:`selectors` module instead, unless they want + precise control over the OS-level primitives used. + + The module defines the following: @@ -37,8 +45,13 @@ The module defines the following: increases this value, :c:func:`devpoll` may return an incomplete list of active file descriptors. + The new file descriptor is :ref:`non-inheritable <fd_inheritance>`. + .. versionadded:: 3.3 + .. versionchanged:: 3.4 + The new file descriptor is now non-inheritable. + .. function:: epoll(sizehint=-1, flags=0) (Only supported on Linux 2.5.44 and newer.) Return an edge polling object, @@ -47,11 +60,17 @@ The module defines the following: to :const:`EPOLL_CLOEXEC`, which causes the epoll descriptor to be closed automatically when :func:`os.execve` is called. See section :ref:`epoll-objects` below for the methods supported by epolling objects. + They also support the :keyword:`with` statement. + The new file descriptor is :ref:`non-inheritable <fd_inheritance>`. .. versionchanged:: 3.3 Added the *flags* parameter. + .. versionchanged:: 3.4 + Support for the :keyword:`with` statement was added. + The new file descriptor is now non-inheritable. + .. function:: poll() @@ -66,6 +85,11 @@ The module defines the following: (Only supported on BSD.) Returns a kernel queue object; see section :ref:`kqueue-objects` below for the methods supported by kqueue objects. + The new file descriptor is :ref:`non-inheritable <fd_inheritance>`. + + .. versionchanged:: 3.4 + The new file descriptor is now non-inheritable. + .. function:: kevent(ident, filter=KQ_FILTER_READ, flags=KQ_EV_ADD, fflags=0, data=0, udata=0) @@ -144,6 +168,27 @@ descriptors), ``/dev/poll`` is O(active file descriptors). object. +.. method:: devpoll.close() + + Close the file descriptor of the polling object. + + .. versionadded:: 3.4 + + +.. attribute:: devpoll.closed + + ``True`` if the polling object is closed. + + .. versionadded:: 3.4 + + +.. method:: devpoll.fileno() + + Return the file descriptor number of the polling object. + + .. versionadded:: 3.4 + + .. method:: devpoll.register(fd[, eventmask]) Register a file descriptor with the polling object. Future calls to the @@ -241,6 +286,11 @@ Edge and Level Trigger Polling (epoll) Objects Close the control file descriptor of the epoll object. +.. attribute:: epoll.closed + + ``True`` if the epoll object is closed. + + .. method:: epoll.fileno() Return the file descriptor number of the control fd. @@ -360,6 +410,11 @@ Kqueue Objects Close the control file descriptor of the kqueue object. +.. attribute:: kqueue.closed + + ``True`` if the kqueue object is closed. + + .. method:: kqueue.fileno() Return the file descriptor number of the control fd. |