]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
ioloop: Update docs for IOLoop constructor 3160/head
authorBen Darnell <ben@bendarnell.com>
Fri, 17 Jun 2022 17:58:10 +0000 (13:58 -0400)
committerBen Darnell <ben@bendarnell.com>
Fri, 17 Jun 2022 18:21:23 +0000 (14:21 -0400)
The constructor is not completely deprecated; the make_current=False
mode is still usable.

Fixes #3156

tornado/ioloop.py

index b907106ef47d0bec27f230f82512dbac91c283d0..2c05755db2e7211f912abebecb7efc68a4d29968 100644 (file)
@@ -119,10 +119,12 @@ class IOLoop(Configurable):
     .. testoutput::
        :hide:
 
-    Do not attempt to construct an `IOLoop` directly; this is deprecated since
-    Tornado 6.2. Instead, initialize the `asyncio` event loop and use
-    `IOLoop.current()` to access an `IOLoop` wrapper around the current event
-    loop.
+    Most applications should not attempt to construct an `IOLoop` directly,
+    and instead initialize the `asyncio` event loop and use `IOLoop.current()`.
+    In some cases, such as in test frameworks when initializing an `IOLoop`
+    to be run in a secondary thread, it may be appropriate to construct
+    an `IOLoop` with ``IOLoop(make_current=False)``. Constructing an `IOLoop`
+    without the ``make_current=False`` argument is deprecated since Tornado 6.2.
 
     In general, an `IOLoop` cannot survive a fork or be shared across processes
     in any way. When multiple processes are being used, each process should