2011-09-04 07:59:57 +00:00
|
|
|
``tornado.gen`` --- Simplify asynchronous code
|
|
|
|
==============================================
|
|
|
|
|
|
|
|
.. automodule:: tornado.gen
|
|
|
|
|
2013-03-15 03:07:58 +00:00
|
|
|
Decorators
|
|
|
|
----------
|
|
|
|
|
|
|
|
.. autofunction:: coroutine
|
2011-09-04 07:59:57 +00:00
|
|
|
|
|
|
|
.. autofunction:: engine
|
|
|
|
|
|
|
|
Yield points
|
|
|
|
------------
|
|
|
|
|
|
|
|
Instances of the following classes may be used in yield expressions
|
2013-03-17 17:42:12 +00:00
|
|
|
in the generator. `Futures <.Future>` may be yielded as well;
|
|
|
|
their result method will be called automatically when they are
|
|
|
|
ready. Additionally, lists of any combination of these objects may
|
|
|
|
be yielded; the result is a list of the results of each yield point
|
2013-10-17 15:44:09 +00:00
|
|
|
in the same order. Yielding dicts with these objects in values will
|
|
|
|
return dict with results at the same keys.
|
2011-09-04 07:59:57 +00:00
|
|
|
|
|
|
|
.. autoclass:: Task
|
|
|
|
|
|
|
|
.. autoclass:: Callback
|
|
|
|
|
|
|
|
.. autoclass:: Wait
|
|
|
|
|
2011-09-04 22:39:55 +00:00
|
|
|
.. autoclass:: WaitAll
|
2011-09-11 22:50:34 +00:00
|
|
|
|
2013-03-16 04:18:46 +00:00
|
|
|
.. autoclass:: YieldPoint
|
|
|
|
:members:
|
|
|
|
|
2014-04-27 03:56:16 +00:00
|
|
|
.. autofunction:: with_timeout
|
|
|
|
.. autoexception:: TimeoutError
|
|
|
|
|
|
|
|
.. autofunction:: maybe_future
|
|
|
|
|
2011-09-11 22:50:34 +00:00
|
|
|
Other classes
|
|
|
|
-------------
|
|
|
|
|
2013-03-16 04:18:46 +00:00
|
|
|
.. autoexception:: Return
|
|
|
|
|
2013-01-27 21:28:35 +00:00
|
|
|
.. class:: Arguments
|
|
|
|
|
|
|
|
The result of a yield expression whose callback had more than one
|
|
|
|
argument (or keyword arguments).
|
|
|
|
|
2013-03-16 04:18:46 +00:00
|
|
|
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``.
|