File: concurrent.rst

package info (click to toggle)
python-tornado 6.2.0-3%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,396 kB
  • sloc: python: 27,837; javascript: 156; sh: 99; ansic: 58; xml: 49; makefile: 48; sql: 23
file content (33 lines) | stat: -rw-r--r-- 1,206 bytes parent folder | download | duplicates (4)
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
``tornado.concurrent`` --- Work with ``Future`` objects
=======================================================

.. testsetup::

   from tornado.concurrent import *
   from tornado import gen

.. automodule:: tornado.concurrent
    :members:

     .. class:: Future

        ``tornado.concurrent.Future`` is an alias for `asyncio.Future`.

        In Tornado, the main way in which applications interact with
        ``Future`` objects is by ``awaiting`` or ``yielding`` them in
        coroutines, instead of calling methods on the ``Future`` objects
        themselves. For more information on the available methods, see
        the `asyncio.Future` docs.

        .. versionchanged:: 5.0

           Tornado's implementation of ``Future`` has been replaced by
           the version from `asyncio` when available.

           - ``Future`` objects can only be created while there is a
             current `.IOLoop`
           - The timing of callbacks scheduled with
             ``Future.add_done_callback`` has changed.
           - Cancellation is now partially supported (only on Python 3)
           - The ``exc_info`` and ``set_exc_info`` methods are no longer
             available on Python 3.