Mercurial > cpython-lru_cache-weakref
annotate Doc/library/select.rst @ 79675:c0a2294de787 2.7
Issue #16199: Backport 2to3 typo fix from 3.2.
| author | Chris Jerdonek <chris.jerdonek@gmail.com> |
|---|---|
| date | Thu, 11 Oct 2012 16:15:46 -0700 |
| parents | 74ff71b2f53d |
| children | c24941251473 |
| rev | line source |
|---|---|
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
1 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
2 :mod:`select` --- Waiting for I/O completion |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
3 ============================================ |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
4 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
5 .. module:: select |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
6 :synopsis: Wait for I/O completion on multiple streams. |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
7 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
8 |
|
74395
74ff71b2f53d
update to new C roles and directives
Sandro Tosi <sandro.tosi@gmail.com>
parents:
68256
diff
changeset
|
9 This module provides access to the :c:func:`select` and :c:func:`poll` functions |
|
74ff71b2f53d
update to new C roles and directives
Sandro Tosi <sandro.tosi@gmail.com>
parents:
68256
diff
changeset
|
10 available in most operating systems, :c:func:`epoll` available on Linux 2.5+ and |
|
74ff71b2f53d
update to new C roles and directives
Sandro Tosi <sandro.tosi@gmail.com>
parents:
68256
diff
changeset
|
11 :c:func:`kqueue` available on most BSD. |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
12 Note that on Windows, it only works for sockets; on other operating systems, |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
13 it also works for other file types (in particular, on Unix, it works on pipes). |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
14 It cannot be used on regular files to determine whether a file has grown since |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
15 it was last read. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
16 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
17 The module defines the following: |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
18 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
19 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
20 .. exception:: error |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
21 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
22 The exception raised when an error occurs. The accompanying value is a pair |
|
74395
74ff71b2f53d
update to new C roles and directives
Sandro Tosi <sandro.tosi@gmail.com>
parents:
68256
diff
changeset
|
23 containing the numeric error code from :c:data:`errno` and the corresponding |
|
74ff71b2f53d
update to new C roles and directives
Sandro Tosi <sandro.tosi@gmail.com>
parents:
68256
diff
changeset
|
24 string, as would be printed by the C function :c:func:`perror`. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
25 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
26 |
|
46034
0a485593ae1c
Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
45991
diff
changeset
|
27 .. function:: epoll([sizehint=-1]) |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
28 |
|
46034
0a485593ae1c
Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
45991
diff
changeset
|
29 (Only supported on Linux 2.5.44 and newer.) Returns an edge polling object, |
|
0a485593ae1c
Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
45991
diff
changeset
|
30 which can be used as Edge or Level Triggered interface for I/O events; see |
|
0a485593ae1c
Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
45991
diff
changeset
|
31 section :ref:`epoll-objects` below for the methods supported by epolling |
|
0a485593ae1c
Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
45991
diff
changeset
|
32 objects. |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
33 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
34 .. versionadded:: 2.6 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
35 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
36 |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
37 .. function:: poll() |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
38 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
39 (Not supported by all operating systems.) Returns a polling object, which |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
40 supports registering and unregistering file descriptors, and then polling them |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
41 for I/O events; see section :ref:`poll-objects` below for the methods supported |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
42 by polling objects. |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
43 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
44 |
|
46034
0a485593ae1c
Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
45991
diff
changeset
|
45 .. function:: kqueue() |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
46 |
|
63503
e8fc9a9e1991
Merged revisions 83452,83457,83466,83471,83475,83480,83486 via svnmerge from
Georg Brandl <georg@python.org>
parents:
59834
diff
changeset
|
47 (Only supported on BSD.) Returns a kernel queue object; see section |
|
46034
0a485593ae1c
Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
45991
diff
changeset
|
48 :ref:`kqueue-objects` below for the methods supported by kqueue objects. |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
49 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
50 .. versionadded:: 2.6 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
51 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
52 |
|
59834
9eabba6ded09
Merged revisions 77120,77151,77155,77209,77229,77256,77317,77331,77333,77359-77360,77382,77561,77570 via svnmerge from
Georg Brandl <georg@python.org>
parents:
56819
diff
changeset
|
53 .. function:: kevent(ident, filter=KQ_FILTER_READ, flags=KQ_EV_ADD, fflags=0, data=0, udata=0) |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
54 |
|
63503
e8fc9a9e1991
Merged revisions 83452,83457,83466,83471,83475,83480,83486 via svnmerge from
Georg Brandl <georg@python.org>
parents:
59834
diff
changeset
|
55 (Only supported on BSD.) Returns a kernel event object; see section |
|
e8fc9a9e1991
Merged revisions 83452,83457,83466,83471,83475,83480,83486 via svnmerge from
Georg Brandl <georg@python.org>
parents:
59834
diff
changeset
|
56 :ref:`kevent-objects` below for the methods supported by kevent objects. |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
57 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
58 .. versionadded:: 2.6 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
59 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
60 |
|
48166
ab4c9c384d31
Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents:
47937
diff
changeset
|
61 .. function:: select(rlist, wlist, xlist[, timeout]) |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
62 |
|
74395
74ff71b2f53d
update to new C roles and directives
Sandro Tosi <sandro.tosi@gmail.com>
parents:
68256
diff
changeset
|
63 This is a straightforward interface to the Unix :c:func:`select` system call. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
64 The first three arguments are sequences of 'waitable objects': either |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
65 integers representing file descriptors or objects with a parameterless method |
|
48166
ab4c9c384d31
Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents:
47937
diff
changeset
|
66 named :meth:`fileno` returning such an integer: |
|
ab4c9c384d31
Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents:
47937
diff
changeset
|
67 |
|
ab4c9c384d31
Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents:
47937
diff
changeset
|
68 * *rlist*: wait until ready for reading |
|
ab4c9c384d31
Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents:
47937
diff
changeset
|
69 * *wlist*: wait until ready for writing |
|
ab4c9c384d31
Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents:
47937
diff
changeset
|
70 * *xlist*: wait for an "exceptional condition" (see the manual page for what |
|
ab4c9c384d31
Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents:
47937
diff
changeset
|
71 your system considers such a condition) |
|
ab4c9c384d31
Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents:
47937
diff
changeset
|
72 |
|
ab4c9c384d31
Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents:
47937
diff
changeset
|
73 Empty sequences are allowed, but acceptance of three empty sequences is |
|
ab4c9c384d31
Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents:
47937
diff
changeset
|
74 platform-dependent. (It is known to work on Unix but not on Windows.) The |
|
ab4c9c384d31
Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents:
47937
diff
changeset
|
75 optional *timeout* argument specifies a time-out as a floating point number |
|
ab4c9c384d31
Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents:
47937
diff
changeset
|
76 in seconds. When the *timeout* argument is omitted the function blocks until |
|
ab4c9c384d31
Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents:
47937
diff
changeset
|
77 at least one file descriptor is ready. A time-out value of zero specifies a |
|
ab4c9c384d31
Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents:
47937
diff
changeset
|
78 poll and never blocks. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
79 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
80 The return value is a triple of lists of objects that are ready: subsets of the |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
81 first three arguments. When the time-out is reached without a file descriptor |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
82 becoming ready, three empty lists are returned. |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
83 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
84 .. index:: |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
85 single: socket() (in module socket) |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
86 single: popen() (in module os) |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
87 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
88 Among the acceptable object types in the sequences are Python file objects (e.g. |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
89 ``sys.stdin``, or objects returned by :func:`open` or :func:`os.popen`), socket |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
90 objects returned by :func:`socket.socket`. You may also define a :dfn:`wrapper` |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
91 class yourself, as long as it has an appropriate :meth:`fileno` method (that |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
92 really returns a file descriptor, not just a random integer). |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
93 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
94 .. note:: |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
95 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
96 .. index:: single: WinSock |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
97 |
|
48166
ab4c9c384d31
Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents:
47937
diff
changeset
|
98 File objects on Windows are not acceptable, but sockets are. On Windows, |
|
74395
74ff71b2f53d
update to new C roles and directives
Sandro Tosi <sandro.tosi@gmail.com>
parents:
68256
diff
changeset
|
99 the underlying :c:func:`select` function is provided by the WinSock |
|
48166
ab4c9c384d31
Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents:
47937
diff
changeset
|
100 library, and does not handle file descriptors that don't originate from |
|
ab4c9c384d31
Clarify the meaning of the select() parameters and sync
Georg Brandl <georg@python.org>
parents:
47937
diff
changeset
|
101 WinSock. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
102 |
|
55085
9c9fe9aafba6
Adds the select.PIPE_BUF attribute to expose the system constant.
Gregory P. Smith <greg@mad-scientist.com>
parents:
54471
diff
changeset
|
103 .. attribute:: select.PIPE_BUF |
|
9c9fe9aafba6
Adds the select.PIPE_BUF attribute to expose the system constant.
Gregory P. Smith <greg@mad-scientist.com>
parents:
54471
diff
changeset
|
104 |
|
9c9fe9aafba6
Adds the select.PIPE_BUF attribute to expose the system constant.
Gregory P. Smith <greg@mad-scientist.com>
parents:
54471
diff
changeset
|
105 Files reported as ready for writing by :func:`select`, :func:`poll` or |
|
9c9fe9aafba6
Adds the select.PIPE_BUF attribute to expose the system constant.
Gregory P. Smith <greg@mad-scientist.com>
parents:
54471
diff
changeset
|
106 similar interfaces in this module are guaranteed to not block on a write |
|
9c9fe9aafba6
Adds the select.PIPE_BUF attribute to expose the system constant.
Gregory P. Smith <greg@mad-scientist.com>
parents:
54471
diff
changeset
|
107 of up to :const:`PIPE_BUF` bytes. |
|
55178
5609352fea12
#6416: Fix compilation of the select module on Windows, as well as test_subprocess:
Amaury Forgeot d'Arc <amauryfa@gmail.com>
parents:
55085
diff
changeset
|
108 This value is guaranteed by POSIX to be at least 512. Availability: Unix. |
|
55085
9c9fe9aafba6
Adds the select.PIPE_BUF attribute to expose the system constant.
Gregory P. Smith <greg@mad-scientist.com>
parents:
54471
diff
changeset
|
109 |
|
9c9fe9aafba6
Adds the select.PIPE_BUF attribute to expose the system constant.
Gregory P. Smith <greg@mad-scientist.com>
parents:
54471
diff
changeset
|
110 .. versionadded:: 2.7 |
|
9c9fe9aafba6
Adds the select.PIPE_BUF attribute to expose the system constant.
Gregory P. Smith <greg@mad-scientist.com>
parents:
54471
diff
changeset
|
111 |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
112 |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
113 .. _epoll-objects: |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
114 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
115 Edge and Level Trigger Polling (epoll) Objects |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
116 ---------------------------------------------- |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
117 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
118 http://linux.die.net/man/4/epoll |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
119 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
120 *eventmask* |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
121 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
122 +-----------------------+-----------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
123 | Constant | Meaning | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
124 +=======================+===============================================+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
125 | :const:`EPOLLIN` | Available for read | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
126 +-----------------------+-----------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
127 | :const:`EPOLLOUT` | Available for write | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
128 +-----------------------+-----------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
129 | :const:`EPOLLPRI` | Urgent data for read | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
130 +-----------------------+-----------------------------------------------+ |
|
46370
2e917b0c8f6e
Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
46034
diff
changeset
|
131 | :const:`EPOLLERR` | Error condition happened on the assoc. fd | |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
132 +-----------------------+-----------------------------------------------+ |
|
46370
2e917b0c8f6e
Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
46034
diff
changeset
|
133 | :const:`EPOLLHUP` | Hang up happened on the assoc. fd | |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
134 +-----------------------+-----------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
135 | :const:`EPOLLET` | Set Edge Trigger behavior, the default is | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
136 | | Level Trigger behavior | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
137 +-----------------------+-----------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
138 | :const:`EPOLLONESHOT` | Set one-shot behavior. After one event is | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
139 | | pulled out, the fd is internally disabled | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
140 +-----------------------+-----------------------------------------------+ |
|
65134
e9e241a93f9e
Merged revisions 82879,82958-82959,83109,83127,83224,83747,84162 via svnmerge from
Georg Brandl <georg@python.org>
parents:
63496
diff
changeset
|
141 | :const:`EPOLLRDNORM` | Equivalent to :const:`EPOLLIN` | |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
142 +-----------------------+-----------------------------------------------+ |
|
65134
e9e241a93f9e
Merged revisions 82879,82958-82959,83109,83127,83224,83747,84162 via svnmerge from
Georg Brandl <georg@python.org>
parents:
63496
diff
changeset
|
143 | :const:`EPOLLRDBAND` | Priority data band can be read. | |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
144 +-----------------------+-----------------------------------------------+ |
|
65134
e9e241a93f9e
Merged revisions 82879,82958-82959,83109,83127,83224,83747,84162 via svnmerge from
Georg Brandl <georg@python.org>
parents:
63496
diff
changeset
|
145 | :const:`EPOLLWRNORM` | Equivalent to :const:`EPOLLOUT` | |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
146 +-----------------------+-----------------------------------------------+ |
|
65134
e9e241a93f9e
Merged revisions 82879,82958-82959,83109,83127,83224,83747,84162 via svnmerge from
Georg Brandl <georg@python.org>
parents:
63496
diff
changeset
|
147 | :const:`EPOLLWRBAND` | Priority data may be written. | |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
148 +-----------------------+-----------------------------------------------+ |
|
65134
e9e241a93f9e
Merged revisions 82879,82958-82959,83109,83127,83224,83747,84162 via svnmerge from
Georg Brandl <georg@python.org>
parents:
63496
diff
changeset
|
149 | :const:`EPOLLMSG` | Ignored. | |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
150 +-----------------------+-----------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
151 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
152 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
153 .. method:: epoll.close() |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
154 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
155 Close the control file descriptor of the epoll object. |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
156 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
157 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
158 .. method:: epoll.fileno() |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
159 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
160 Return the file descriptor number of the control fd. |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
161 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
162 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
163 .. method:: epoll.fromfd(fd) |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
164 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
165 Create an epoll object from a given file descriptor. |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
166 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
167 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
168 .. method:: epoll.register(fd[, eventmask]) |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
169 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
170 Register a fd descriptor with the epoll object. |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
171 |
|
54471
c3a26556dd14
Merged revisions 73077 via svnmerge from
R. David Murray <rdmurray@bitdance.com>
parents:
49677
diff
changeset
|
172 .. note:: |
|
c3a26556dd14
Merged revisions 73077 via svnmerge from
R. David Murray <rdmurray@bitdance.com>
parents:
49677
diff
changeset
|
173 |
|
c3a26556dd14
Merged revisions 73077 via svnmerge from
R. David Murray <rdmurray@bitdance.com>
parents:
49677
diff
changeset
|
174 Registering a file descriptor that's already registered raises an |
|
c3a26556dd14
Merged revisions 73077 via svnmerge from
R. David Murray <rdmurray@bitdance.com>
parents:
49677
diff
changeset
|
175 IOError -- contrary to :ref:`poll-objects`'s register. |
|
c3a26556dd14
Merged revisions 73077 via svnmerge from
R. David Murray <rdmurray@bitdance.com>
parents:
49677
diff
changeset
|
176 |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
177 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
178 .. method:: epoll.modify(fd, eventmask) |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
179 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
180 Modify a register file descriptor. |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
181 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
182 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
183 .. method:: epoll.unregister(fd) |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
184 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
185 Remove a registered file descriptor from the epoll object. |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
186 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
187 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
188 .. method:: epoll.poll([timeout=-1[, maxevents=-1]]) |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
189 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
190 Wait for events. timeout in seconds (float) |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
191 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
192 |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
193 .. _poll-objects: |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
194 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
195 Polling Objects |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
196 --------------- |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
197 |
|
74395
74ff71b2f53d
update to new C roles and directives
Sandro Tosi <sandro.tosi@gmail.com>
parents:
68256
diff
changeset
|
198 The :c:func:`poll` system call, supported on most Unix systems, provides better |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
199 scalability for network servers that service many, many clients at the same |
|
74395
74ff71b2f53d
update to new C roles and directives
Sandro Tosi <sandro.tosi@gmail.com>
parents:
68256
diff
changeset
|
200 time. :c:func:`poll` scales better because the system call only requires listing |
|
74ff71b2f53d
update to new C roles and directives
Sandro Tosi <sandro.tosi@gmail.com>
parents:
68256
diff
changeset
|
201 the file descriptors of interest, while :c:func:`select` builds a bitmap, turns |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
202 on bits for the fds of interest, and then afterward the whole bitmap has to be |
|
74395
74ff71b2f53d
update to new C roles and directives
Sandro Tosi <sandro.tosi@gmail.com>
parents:
68256
diff
changeset
|
203 linearly scanned again. :c:func:`select` is O(highest file descriptor), while |
|
74ff71b2f53d
update to new C roles and directives
Sandro Tosi <sandro.tosi@gmail.com>
parents:
68256
diff
changeset
|
204 :c:func:`poll` is O(number of file descriptors). |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
205 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
206 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
207 .. method:: poll.register(fd[, eventmask]) |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
208 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
209 Register a file descriptor with the polling object. Future calls to the |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
210 :meth:`poll` method will then check whether the file descriptor has any pending |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
211 I/O events. *fd* can be either an integer, or an object with a :meth:`fileno` |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
212 method that returns an integer. File objects implement :meth:`fileno`, so they |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
213 can also be used as the argument. |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
214 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
215 *eventmask* is an optional bitmask describing the type of events you want to |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
216 check for, and can be a combination of the constants :const:`POLLIN`, |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
217 :const:`POLLPRI`, and :const:`POLLOUT`, described in the table below. If not |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
218 specified, the default value used will check for all 3 types of events. |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
219 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
220 +-------------------+------------------------------------------+ |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
221 | Constant | Meaning | |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
222 +===================+==========================================+ |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
223 | :const:`POLLIN` | There is data to read | |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
224 +-------------------+------------------------------------------+ |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
225 | :const:`POLLPRI` | There is urgent data to read | |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
226 +-------------------+------------------------------------------+ |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
227 | :const:`POLLOUT` | Ready for output: writing will not block | |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
228 +-------------------+------------------------------------------+ |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
229 | :const:`POLLERR` | Error condition of some sort | |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
230 +-------------------+------------------------------------------+ |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
231 | :const:`POLLHUP` | Hung up | |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
232 +-------------------+------------------------------------------+ |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
233 | :const:`POLLNVAL` | Invalid request: descriptor not open | |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
234 +-------------------+------------------------------------------+ |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
235 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
236 Registering a file descriptor that's already registered is not an error, and has |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
237 the same effect as registering the descriptor exactly once. |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
238 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
239 |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
240 .. method:: poll.modify(fd, eventmask) |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
241 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
242 Modifies an already registered fd. This has the same effect as |
|
65134
e9e241a93f9e
Merged revisions 82879,82958-82959,83109,83127,83224,83747,84162 via svnmerge from
Georg Brandl <georg@python.org>
parents:
63496
diff
changeset
|
243 ``register(fd, eventmask)``. Attempting to modify a file descriptor |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
244 that was never registered causes an :exc:`IOError` exception with errno |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
245 :const:`ENOENT` to be raised. |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
246 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
247 .. versionadded:: 2.6 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
248 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
249 |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
250 .. method:: poll.unregister(fd) |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
251 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
252 Remove a file descriptor being tracked by a polling object. Just like the |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
253 :meth:`register` method, *fd* can be an integer or an object with a |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
254 :meth:`fileno` method that returns an integer. |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
255 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
256 Attempting to remove a file descriptor that was never registered causes a |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
257 :exc:`KeyError` exception to be raised. |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
258 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
259 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
260 .. method:: poll.poll([timeout]) |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
261 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
262 Polls the set of registered file descriptors, and returns a possibly-empty list |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
263 containing ``(fd, event)`` 2-tuples for the descriptors that have events or |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
264 errors to report. *fd* is the file descriptor, and *event* is a bitmask with |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
265 bits set for the reported events for that descriptor --- :const:`POLLIN` for |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
266 waiting input, :const:`POLLOUT` to indicate that the descriptor can be written |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
267 to, and so forth. An empty list indicates that the call timed out and no file |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
268 descriptors had any events to report. If *timeout* is given, it specifies the |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
269 length of time in milliseconds which the system will wait for events before |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
270 returning. If *timeout* is omitted, negative, or :const:`None`, the call will |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
271 block until there is an event for this poll object. |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
272 |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
273 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
274 .. _kqueue-objects: |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
275 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
276 Kqueue Objects |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
277 -------------- |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
278 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
279 .. method:: kqueue.close() |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
280 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
281 Close the control file descriptor of the kqueue object. |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
282 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
283 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
284 .. method:: kqueue.fileno() |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
285 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
286 Return the file descriptor number of the control fd. |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
287 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
288 |
|
49241
50b1e55756a5
#3852: fix some select.kqueue and kevent docs.
Georg Brandl <georg@python.org>
parents:
48166
diff
changeset
|
289 .. method:: kqueue.fromfd(fd) |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
290 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
291 Create a kqueue object from a given file descriptor. |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
292 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
293 |
|
49241
50b1e55756a5
#3852: fix some select.kqueue and kevent docs.
Georg Brandl <georg@python.org>
parents:
48166
diff
changeset
|
294 .. method:: kqueue.control(changelist, max_events[, timeout=None]) -> eventlist |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
295 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
296 Low level interface to kevent |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
297 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
298 - changelist must be an iterable of kevent object or None |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
299 - max_events must be 0 or a positive integer |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
300 - timeout in seconds (floats possible) |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
301 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
302 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
303 .. _kevent-objects: |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
304 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
305 Kevent Objects |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
306 -------------- |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
307 |
|
46034
0a485593ae1c
Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
45991
diff
changeset
|
308 http://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2 |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
309 |
|
46034
0a485593ae1c
Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
45991
diff
changeset
|
310 .. attribute:: kevent.ident |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
311 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
312 Value used to identify the event. The interpretation depends on the filter |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
313 but it's usually the file descriptor. In the constructor ident can either |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
314 be an int or an object with a fileno() function. kevent stores the integer |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
315 internally. |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
316 |
|
46034
0a485593ae1c
Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
45991
diff
changeset
|
317 .. attribute:: kevent.filter |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
318 |
|
56819
9b24d010133f
Merged revisions 74210,74239,74252-74253,74256,74258-74261,74332-74333,74404,74411,74445,74465,74467,74488 via svnmerge from
Georg Brandl <georg@python.org>
parents:
54471
diff
changeset
|
319 Name of the kernel filter. |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
320 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
321 +---------------------------+---------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
322 | Constant | Meaning | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
323 +===========================+=============================================+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
324 | :const:`KQ_FILTER_READ` | Takes a descriptor and returns whenever | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
325 | | there is data available to read | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
326 +---------------------------+---------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
327 | :const:`KQ_FILTER_WRITE` | Takes a descriptor and returns whenever | |
|
56819
9b24d010133f
Merged revisions 74210,74239,74252-74253,74256,74258-74261,74332-74333,74404,74411,74445,74465,74467,74488 via svnmerge from
Georg Brandl <georg@python.org>
parents:
54471
diff
changeset
|
328 | | there is data available to write | |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
329 +---------------------------+---------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
330 | :const:`KQ_FILTER_AIO` | AIO requests | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
331 +---------------------------+---------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
332 | :const:`KQ_FILTER_VNODE` | Returns when one or more of the requested | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
333 | | events watched in *fflag* occurs | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
334 +---------------------------+---------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
335 | :const:`KQ_FILTER_PROC` | Watch for events on a process id | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
336 +---------------------------+---------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
337 | :const:`KQ_FILTER_NETDEV` | Watch for events on a network device | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
338 | | [not available on Mac OS X] | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
339 +---------------------------+---------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
340 | :const:`KQ_FILTER_SIGNAL` | Returns whenever the watched signal is | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
341 | | delivered to the process | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
342 +---------------------------+---------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
343 | :const:`KQ_FILTER_TIMER` | Establishes an arbitrary timer | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
344 +---------------------------+---------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
345 |
|
46034
0a485593ae1c
Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
45991
diff
changeset
|
346 .. attribute:: kevent.flags |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
347 |
|
56819
9b24d010133f
Merged revisions 74210,74239,74252-74253,74256,74258-74261,74332-74333,74404,74411,74445,74465,74467,74488 via svnmerge from
Georg Brandl <georg@python.org>
parents:
54471
diff
changeset
|
348 Filter action. |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
349 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
350 +---------------------------+---------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
351 | Constant | Meaning | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
352 +===========================+=============================================+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
353 | :const:`KQ_EV_ADD` | Adds or modifies an event | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
354 +---------------------------+---------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
355 | :const:`KQ_EV_DELETE` | Removes an event from the queue | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
356 +---------------------------+---------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
357 | :const:`KQ_EV_ENABLE` | Permitscontrol() to returns the event | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
358 +---------------------------+---------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
359 | :const:`KQ_EV_DISABLE` | Disablesevent | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
360 +---------------------------+---------------------------------------------+ |
|
47937
38d3a50defec
fix various doc typos #3320
Benjamin Peterson <benjamin@python.org>
parents:
46370
diff
changeset
|
361 | :const:`KQ_EV_ONESHOT` | Removes event after first occurrence | |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
362 +---------------------------+---------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
363 | :const:`KQ_EV_CLEAR` | Reset the state after an event is retrieved | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
364 +---------------------------+---------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
365 | :const:`KQ_EV_SYSFLAGS` | internal event | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
366 +---------------------------+---------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
367 | :const:`KQ_EV_FLAG1` | internal event | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
368 +---------------------------+---------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
369 | :const:`KQ_EV_EOF` | Filter specific EOF condition | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
370 +---------------------------+---------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
371 | :const:`KQ_EV_ERROR` | See return values | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
372 +---------------------------+---------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
373 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
374 |
|
46034
0a485593ae1c
Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
45991
diff
changeset
|
375 .. attribute:: kevent.fflags |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
376 |
|
56819
9b24d010133f
Merged revisions 74210,74239,74252-74253,74256,74258-74261,74332-74333,74404,74411,74445,74465,74467,74488 via svnmerge from
Georg Brandl <georg@python.org>
parents:
54471
diff
changeset
|
377 Filter specific flags. |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
378 |
|
56819
9b24d010133f
Merged revisions 74210,74239,74252-74253,74256,74258-74261,74332-74333,74404,74411,74445,74465,74467,74488 via svnmerge from
Georg Brandl <georg@python.org>
parents:
54471
diff
changeset
|
379 :const:`KQ_FILTER_READ` and :const:`KQ_FILTER_WRITE` filter flags: |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
380 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
381 +----------------------------+--------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
382 | Constant | Meaning | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
383 +============================+============================================+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
384 | :const:`KQ_NOTE_LOWAT` | low water mark of a socket buffer | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
385 +----------------------------+--------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
386 |
|
56819
9b24d010133f
Merged revisions 74210,74239,74252-74253,74256,74258-74261,74332-74333,74404,74411,74445,74465,74467,74488 via svnmerge from
Georg Brandl <georg@python.org>
parents:
54471
diff
changeset
|
387 :const:`KQ_FILTER_VNODE` filter flags: |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
388 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
389 +----------------------------+--------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
390 | Constant | Meaning | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
391 +============================+============================================+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
392 | :const:`KQ_NOTE_DELETE` | *unlink()* was called | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
393 +----------------------------+--------------------------------------------+ |
|
47937
38d3a50defec
fix various doc typos #3320
Benjamin Peterson <benjamin@python.org>
parents:
46370
diff
changeset
|
394 | :const:`KQ_NOTE_WRITE` | a write occurred | |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
395 +----------------------------+--------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
396 | :const:`KQ_NOTE_EXTEND` | the file was extended | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
397 +----------------------------+--------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
398 | :const:`KQ_NOTE_ATTRIB` | an attribute was changed | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
399 +----------------------------+--------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
400 | :const:`KQ_NOTE_LINK` | the link count has changed | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
401 +----------------------------+--------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
402 | :const:`KQ_NOTE_RENAME` | the file was renamed | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
403 +----------------------------+--------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
404 | :const:`KQ_NOTE_REVOKE` | access to the file was revoked | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
405 +----------------------------+--------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
406 |
|
56819
9b24d010133f
Merged revisions 74210,74239,74252-74253,74256,74258-74261,74332-74333,74404,74411,74445,74465,74467,74488 via svnmerge from
Georg Brandl <georg@python.org>
parents:
54471
diff
changeset
|
407 :const:`KQ_FILTER_PROC` filter flags: |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
408 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
409 +----------------------------+--------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
410 | Constant | Meaning | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
411 +============================+============================================+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
412 | :const:`KQ_NOTE_EXIT` | the process has exited | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
413 +----------------------------+--------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
414 | :const:`KQ_NOTE_FORK` | the process has called *fork()* | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
415 +----------------------------+--------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
416 | :const:`KQ_NOTE_EXEC` | the process has executed a new process | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
417 +----------------------------+--------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
418 | :const:`KQ_NOTE_PCTRLMASK` | internal filter flag | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
419 +----------------------------+--------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
420 | :const:`KQ_NOTE_PDATAMASK` | internal filter flag | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
421 +----------------------------+--------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
422 | :const:`KQ_NOTE_TRACK` | follow a process across *fork()* | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
423 +----------------------------+--------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
424 | :const:`KQ_NOTE_CHILD` | returned on the child process for | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
425 | | *NOTE_TRACK* | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
426 +----------------------------+--------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
427 | :const:`KQ_NOTE_TRACKERR` | unable to attach to a child | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
428 +----------------------------+--------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
429 |
|
56819
9b24d010133f
Merged revisions 74210,74239,74252-74253,74256,74258-74261,74332-74333,74404,74411,74445,74465,74467,74488 via svnmerge from
Georg Brandl <georg@python.org>
parents:
54471
diff
changeset
|
430 :const:`KQ_FILTER_NETDEV` filter flags (not available on Mac OS X): |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
431 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
432 +----------------------------+--------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
433 | Constant | Meaning | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
434 +============================+============================================+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
435 | :const:`KQ_NOTE_LINKUP` | link is up | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
436 +----------------------------+--------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
437 | :const:`KQ_NOTE_LINKDOWN` | link is down | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
438 +----------------------------+--------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
439 | :const:`KQ_NOTE_LINKINV` | link state is invalid | |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
440 +----------------------------+--------------------------------------------+ |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
441 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
442 |
|
46034
0a485593ae1c
Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
45991
diff
changeset
|
443 .. attribute:: kevent.data |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
444 |
|
56819
9b24d010133f
Merged revisions 74210,74239,74252-74253,74256,74258-74261,74332-74333,74404,74411,74445,74465,74467,74488 via svnmerge from
Georg Brandl <georg@python.org>
parents:
54471
diff
changeset
|
445 Filter specific data. |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
446 |
|
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
447 |
|
46034
0a485593ae1c
Merged revisions 61724-61725,61731-61735,61737,61739,61741,61743-61744,61753,61761,61765-61767,61769,61773,61776-61778,61780-61783,61788,61793,61796,61807,61813 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
45991
diff
changeset
|
448 .. attribute:: kevent.udata |
|
45991
728dc13327b2
Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents:
44396
diff
changeset
|
449 |
|
56819
9b24d010133f
Merged revisions 74210,74239,74252-74253,74256,74258-74261,74332-74333,74404,74411,74445,74465,74467,74488 via svnmerge from
Georg Brandl <georg@python.org>
parents:
54471
diff
changeset
|
450 User defined value. |
