@@ -99,7 +99,7 @@ To schedule a callback from a different thread, the
9999:meth: `BaseEventLoop.call_soon_threadsafe ` method should be used. Example to
100100schedule a coroutine from a different thread::
101101
102- loop.call_soon_threadsafe(asyncio.async , coro_func())
102+ loop.call_soon_threadsafe(asyncio.ensure_future , coro_func())
103103
104104Most asyncio objects are not thread safe. You should only worry if you access
105105objects outside the event loop. For example, to cancel a future, don't call
@@ -162,10 +162,10 @@ Detect coroutine objects never scheduled
162162----------------------------------------
163163
164164When a coroutine function is called and its result is not passed to
165- :func: `async ` or to the :meth: `BaseEventLoop.create_task ` method, the execution
166- of the coroutine object will never be scheduled which is probably a bug.
167- :ref: `Enable the debug mode of asyncio <asyncio-debug-mode >` to :ref: ` log a
168- warning <asyncio-logger>` to detect it.
165+ :func: `ensure_future ` or to the :meth: `BaseEventLoop.create_task ` method,
166+ the execution of the coroutine object will never be scheduled which is
167+ probably a bug. :ref: `Enable the debug mode of asyncio <asyncio-debug-mode >`
168+ to :ref: ` log a warning <asyncio-logger >` to detect it.
169169
170170Example with the bug::
171171
@@ -184,7 +184,7 @@ Output in debug mode::
184184 File "test.py", line 7, in <module>
185185 test()
186186
187- The fix is to call the :func: `async ` function or the
187+ The fix is to call the :func: `ensure_future ` function or the
188188:meth: `BaseEventLoop.create_task ` method with the coroutine object.
189189
190190.. seealso ::
0 commit comments