Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(7)

Side by Side Diff: Doc/library/select.rst

Issue 29247: Document return value of epoll.poll
Patch Set: Created 3 years ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 :mod:`select` --- Waiting for I/O completion 1 :mod:`select` --- Waiting for I/O completion
2 ============================================ 2 ============================================
3 3
4 .. module:: select 4 .. module:: select
5 :synopsis: Wait for I/O completion on multiple streams. 5 :synopsis: Wait for I/O completion on multiple streams.
6 6
7 -------------- 7 --------------
8 8
9 This module provides access to the :c:func:`select` and :c:func:`poll` functions 9 This module provides access to the :c:func:`select` and :c:func:`poll` functions
10 available in most operating systems, :c:func:`devpoll` available on 10 available in most operating systems, :c:func:`devpoll` available on
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 a signal, except if the signal handler raises an exception (see 257 a signal, except if the signal handler raises an exception (see
258 :pep:`475` for the rationale), instead of raising 258 :pep:`475` for the rationale), instead of raising
259 :exc:`InterruptedError`. 259 :exc:`InterruptedError`.
260 260
261 261
262 .. _epoll-objects: 262 .. _epoll-objects:
263 263
264 Edge and Level Trigger Polling (epoll) Objects 264 Edge and Level Trigger Polling (epoll) Objects
265 ---------------------------------------------- 265 ----------------------------------------------
266 266
267 http://linux.die.net/man/4/epoll 267 .. method:: epoll.close()
268 268
269 *eventmask* 269 Close the control file descriptor of the epoll object.
270
271
272 .. attribute:: epoll.closed
273
274 ``True`` if the epoll object is closed.
275
276
277 .. method:: epoll.fileno()
278
279 Return the file descriptor number of the control fd.
280
281
282 .. method:: epoll.fromfd(fd)
283
284 Create an epoll object from a given file descriptor.
285
286
287 .. method:: epoll.register(fd[, eventmask])
288
289 Register a fd descriptor with the epoll object.
290
291 *eventmask* is an optional bitmask describing the type of events you want
292 to check for. The following constants can be used with
293 :meth:`~epoll.register` and :meth:`~epoll.modify` methods. See
294 :manpage:`epoll(4)` for more information.
270 295
271 +-------------------------+-----------------------------------------------+ 296 +-------------------------+-----------------------------------------------+
272 | Constant | Meaning | 297 | Constant | Meaning |
273 +=========================+===============================================+ 298 +=========================+===============================================+
274 | :const:`EPOLLIN` | Available for read | 299 | :const:`EPOLLIN` | Available for read |
275 +-------------------------+-----------------------------------------------+ 300 +-------------------------+-----------------------------------------------+
276 | :const:`EPOLLOUT` | Available for write | 301 | :const:`EPOLLOUT` | Available for write |
277 +-------------------------+-----------------------------------------------+ 302 +-------------------------+-----------------------------------------------+
278 | :const:`EPOLLPRI` | Urgent data for read | 303 | :const:`EPOLLPRI` | Urgent data for read |
279 +-------------------------+-----------------------------------------------+ 304 +-------------------------+-----------------------------------------------+
(...skipping 18 matching lines...) Expand all
298 | :const:`EPOLLRDNORM` | Equivalent to :const:`EPOLLIN` | 323 | :const:`EPOLLRDNORM` | Equivalent to :const:`EPOLLIN` |
299 +-------------------------+-----------------------------------------------+ 324 +-------------------------+-----------------------------------------------+
300 | :const:`EPOLLRDBAND` | Priority data band can be read. | 325 | :const:`EPOLLRDBAND` | Priority data band can be read. |
301 +-------------------------+-----------------------------------------------+ 326 +-------------------------+-----------------------------------------------+
302 | :const:`EPOLLWRNORM` | Equivalent to :const:`EPOLLOUT` | 327 | :const:`EPOLLWRNORM` | Equivalent to :const:`EPOLLOUT` |
303 +-------------------------+-----------------------------------------------+ 328 +-------------------------+-----------------------------------------------+
304 | :const:`EPOLLWRBAND` | Priority data may be written. | 329 | :const:`EPOLLWRBAND` | Priority data may be written. |
305 +-------------------------+-----------------------------------------------+ 330 +-------------------------+-----------------------------------------------+
306 | :const:`EPOLLMSG` | Ignored. | 331 | :const:`EPOLLMSG` | Ignored. |
307 +-------------------------+-----------------------------------------------+ 332 +-------------------------+-----------------------------------------------+
308
309
310 .. method:: epoll.close()
311
312 Close the control file descriptor of the epoll object.
313
314
315 .. attribute:: epoll.closed
316
317 ``True`` if the epoll object is closed.
318
319
320 .. method:: epoll.fileno()
321
322 Return the file descriptor number of the control fd.
323
324
325 .. method:: epoll.fromfd(fd)
326
327 Create an epoll object from a given file descriptor.
328
329
330 .. method:: epoll.register(fd[, eventmask])
331
332 Register a fd descriptor with the epoll object.
333
334 333
335 .. method:: epoll.modify(fd, eventmask) 334 .. method:: epoll.modify(fd, eventmask)
336 335
337 Modify a registered file descriptor. 336 Modify a registered file descriptor.
338 337
339 338
340 .. method:: epoll.unregister(fd) 339 .. method:: epoll.unregister(fd)
341 340
342 Remove a registered file descriptor from the epoll object. 341 Remove a registered file descriptor from the epoll object.
343 342
344 343
345 .. method:: epoll.poll(timeout=-1, maxevents=-1) 344 .. method:: epoll.poll(timeout=-1, maxevents=-1)
346 345
347 Wait for events. timeout in seconds (float) 346 Wait for events. *timeout* in seconds (float) Return a list of
marco.buttu 2017/01/30 12:39:39 Is there a missing dot after (float)? I mean: "...
marco.buttu 2017/01/30 12:53:12 Maybe it is worth indicating that timeout=-1 makes
347 ``(fd, eventmask)`` tuples if there's any event. Otherwise, an empty list
348 is returned.
348 349
349 .. versionchanged:: 3.5 350 .. versionchanged:: 3.5
350 The function is now retried with a recomputed timeout when interrupted by 351 The function is now retried with a recomputed timeout when interrupted by
351 a signal, except if the signal handler raises an exception (see 352 a signal, except if the signal handler raises an exception (see
352 :pep:`475` for the rationale), instead of raising 353 :pep:`475` for the rationale), instead of raising
353 :exc:`InterruptedError`. 354 :exc:`InterruptedError`.
354 355
355 356
356 .. _poll-objects: 357 .. _poll-objects:
357 358
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 623
623 624
624 .. attribute:: kevent.data 625 .. attribute:: kevent.data
625 626
626 Filter specific data. 627 Filter specific data.
627 628
628 629
629 .. attribute:: kevent.udata 630 .. attribute:: kevent.udata
630 631
631 User defined value. 632 User defined value.
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+