~pythonregexp2.7/python/issue2636-09-01+10

« back to all changes in this revision

Viewing changes to Doc/library/select.rst

  • Committer: Jeffrey C. "The TimeHorse" Jacobs
  • Date: 2008-09-22 21:39:45 UTC
  • mfrom: (39055.1.33 Regexp-2.7)
  • Revision ID: darklord@timehorse.com-20080922213945-23717m5eiqpamcyn
Merged in changes from the Single-Loop Engine branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
   .. versionadded:: 2.6
51
51
 
52
52
 
53
 
.. function:: kqueue(ident, filter=KQ_FILTER_READ, flags=KQ_ADD, fflags=0, data=0, udata=0)
 
53
.. function:: kevent(ident, filter=KQ_FILTER_READ, flags=KQ_ADD, fflags=0, data=0, udata=0)
54
54
 
55
55
   (Only supported on BSD.)  Returns a kernel event object object; see section
56
56
   :ref:`kevent-objects` below for the methods supported by kqueue objects.
58
58
   .. versionadded:: 2.6
59
59
 
60
60
 
61
 
.. function:: select(iwtd, owtd, ewtd[, timeout])
 
61
.. function:: select(rlist, wlist, xlist[, timeout])
62
62
 
63
63
   This is a straightforward interface to the Unix :cfunc:`select` system call.
64
64
   The first three arguments are sequences of 'waitable objects': either
65
65
   integers representing file descriptors or objects with a parameterless method
66
 
   named :meth:`fileno` returning such an integer.  The three sequences of
67
 
   waitable objects are for input, output and 'exceptional conditions',
68
 
   respectively.  Empty sequences are allowed, but acceptance of three empty
69
 
   sequences is platform-dependent. (It is known to work on Unix but not on
70
 
   Windows.)  The optional *timeout* argument specifies a time-out as a floating
71
 
   point number in seconds.  When the *timeout* argument is omitted the function
72
 
   blocks until at least one file descriptor is ready.  A time-out value of zero
73
 
   specifies a poll and never blocks.
 
66
   named :meth:`fileno` returning such an integer:
 
67
 
 
68
   * *rlist*: wait until ready for reading
 
69
   * *wlist*: wait until ready for writing
 
70
   * *xlist*: wait for an "exceptional condition" (see the manual page for what
 
71
     your system considers such a condition)
 
72
 
 
73
   Empty sequences are allowed, but acceptance of three empty sequences is
 
74
   platform-dependent. (It is known to work on Unix but not on Windows.)  The
 
75
   optional *timeout* argument specifies a time-out as a floating point number
 
76
   in seconds.  When the *timeout* argument is omitted the function blocks until
 
77
   at least one file descriptor is ready.  A time-out value of zero specifies a
 
78
   poll and never blocks.
74
79
 
75
80
   The return value is a triple of lists of objects that are ready: subsets of the
76
81
   first three arguments.  When the time-out is reached without a file descriptor
90
95
 
91
96
      .. index:: single: WinSock
92
97
 
93
 
      File objects on Windows are not acceptable, but sockets are.  On Windows, the
94
 
      underlying :cfunc:`select` function is provided by the WinSock library, and does
95
 
      not handle file descriptors that don't originate from WinSock.
 
98
      File objects on Windows are not acceptable, but sockets are.  On Windows,
 
99
      the underlying :cfunc:`select` function is provided by the WinSock
 
100
      library, and does not handle file descriptors that don't originate from
 
101
      WinSock.
96
102
 
97
103
 
98
104
.. _epoll-objects:
266
272
   Return the file descriptor number of the control fd.
267
273
 
268
274
 
269
 
.. method:: epoll.fromfd(fd)
 
275
.. method:: kqueue.fromfd(fd)
270
276
 
271
277
   Create a kqueue object from a given file descriptor.
272
278
 
273
279
 
274
 
.. method:: control(changelist, max_events=0[, timeout=None]) -> eventlist
 
280
.. method:: kqueue.control(changelist, max_events[, timeout=None]) -> eventlist
275
281
 
276
282
   Low level interface to kevent
277
283
 
338
344
   +---------------------------+---------------------------------------------+
339
345
   | :const:`KQ_EV_DISABLE`    | Disablesevent                               |
340
346
   +---------------------------+---------------------------------------------+
341
 
   | :const:`KQ_EV_ONESHOT`    | Removes event after first occurence         |
 
347
   | :const:`KQ_EV_ONESHOT`    | Removes event after first occurrence        |
342
348
   +---------------------------+---------------------------------------------+
343
349
   | :const:`KQ_EV_CLEAR`      | Reset the state after an event is retrieved |
344
350
   +---------------------------+---------------------------------------------+
373
379
   +============================+============================================+
374
380
   | :const:`KQ_NOTE_DELETE`    | *unlink()* was called                      |
375
381
   +----------------------------+--------------------------------------------+
376
 
   | :const:`KQ_NOTE_WRITE`     | a write occured                            |
 
382
   | :const:`KQ_NOTE_WRITE`     | a write occurred                           |
377
383
   +----------------------------+--------------------------------------------+
378
384
   | :const:`KQ_NOTE_EXTEND`    | the file was extended                      |
379
385
   +----------------------------+--------------------------------------------+