tornado/docs/gen.rst

72 lines
1.5 KiB
ReStructuredText
Raw Normal View History

``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
2014-04-27 03:56:16 +00:00
.. autofunction:: with_timeout
.. autoexception:: TimeoutError
.. autofunction:: maybe_future
2015-01-24 23:18:09 +00:00
.. autofunction:: sleep
.. autodata:: moment
:annotation:
2015-01-24 23:18:09 +00:00
.. autoclass:: WaitIterator
2015-01-24 23:38:18 +00:00
:members:
2015-01-24 23:18:09 +00:00
.. autofunction:: multi
2015-04-19 16:05:29 +00:00
.. 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``.
2015-01-19 17:34:19 +00:00
.. autofunction:: convert_yielded
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
2015-04-19 16:05:29 +00:00
.. autoclass:: MultiYieldPoint