File: gen.rst

package info (click to toggle)
python-tornado 4.4.2-1~bpo8%2B2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 3,020 kB
  • sloc: python: 25,036; sh: 130; xml: 49; ansic: 45; makefile: 45; sql: 26
file content (71 lines) | stat: -rw-r--r-- 1,584 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
``tornado.gen`` --- Simplify asynchronous code
==============================================

.. testsetup::

   from tornado.web import *
   from tornado import gen

.. automodule:: tornado.gen

   Decorators
   ----------

   .. autofunction:: coroutine

   .. autofunction:: engine

   Utility functions
   -----------------

   .. autoexception:: Return

   .. autofunction:: with_timeout
   .. autoexception:: TimeoutError

   .. autofunction:: sleep

   .. autodata:: moment
      :annotation:

   .. autoclass:: WaitIterator
      :members:

   .. autofunction:: multi

   .. autofunction:: multi_future

   .. autofunction:: Task

   .. class:: Arguments

      The result of a `Task` or `Wait` whose callback had more than one
      argument (or keyword arguments).

      The `Arguments` object is a `collections.namedtuple` and can be
      used either as a tuple ``(args, kwargs)`` or an object with attributes
      ``args`` and ``kwargs``.

   .. autofunction:: convert_yielded

   .. autofunction:: maybe_future

   Legacy interface
   ----------------

   Before support for `Futures <.Future>` was introduced in Tornado 3.0,
   coroutines used subclasses of `YieldPoint` in their ``yield`` expressions.
   These classes are still supported but should generally not be used
   except for compatibility with older interfaces. None of these classes
   are compatible with native (``await``-based) coroutines.

   .. autoclass:: YieldPoint
      :members:

   .. autoclass:: Callback

   .. autoclass:: Wait

   .. autoclass:: WaitAll

   .. autoclass:: MultiYieldPoint