File: twisted.rst

package info (click to toggle)
python-tornado 6.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 3,176 kB
  • sloc: python: 28,920; javascript: 156; sh: 100; ansic: 72; xml: 49; makefile: 49; sql: 23
file content (34 lines) | stat: -rw-r--r-- 1,384 bytes parent folder | download
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
``tornado.platform.twisted`` --- Bridges between Twisted and Tornado
====================================================================

.. module:: tornado.platform.twisted

.. deprecated:: 6.0

   This module is no longer recommended for new code. Instead of using
   direct integration between Tornado and Twisted, new applications should
   rely on the integration with ``asyncio`` provided by both packages.

Importing this module has the side effect of registering Twisted's ``Deferred``
class with Tornado's ``@gen.coroutine`` so that ``Deferred`` objects can be
used with ``yield`` in coroutines using this decorator (importing this module has
no effect on native coroutines using ``async def``). 

.. function:: install()

    Install ``AsyncioSelectorReactor`` as the default Twisted reactor.

    .. deprecated:: 5.1

       This function is provided for backwards compatibility; code
       that does not require compatibility with older versions of
       Tornado should use
       ``twisted.internet.asyncioreactor.install()`` directly.

    .. versionchanged:: 6.0.3

       In Tornado 5.x and before, this function installed a reactor
       based on the Tornado ``IOLoop``. When that reactor
       implementation was removed in Tornado 6.0.0, this function was
       removed as well. It was restored in Tornado 6.0.3 using the
       ``asyncio`` reactor instead.