Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e7cc03 commit 790202dCopy full SHA for 790202d
1 file changed
Doc/library/asyncio-dev.rst
@@ -23,6 +23,12 @@ schedule a coroutine from a different thread::
23
24
loop.call_soon_threadsafe(asyncio.async, coro_func())
25
26
+Most asyncio objects are not thread safe. You should only worry if you access
27
+objects outside the event loop. For example, to cancel a future, don't call
28
+directly its :meth:`Future.cancel` method, but::
29
+
30
+ loop.call_soon_threadsafe(fut.cancel)
31
32
To handle signals and to execute subprocesses, the event loop must be run in
33
the main thread.
34
0 commit comments