diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2020-06-23 02:23:49 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-23 02:23:49 (GMT) |
commit | 56d25add07093701c4827ea3a46b7025d9030f3c (patch) | |
tree | 27c25c60f6b4d4187b2148154471f44c402d7705 /Doc/library | |
parent | d7f37d1ed4fd38555e3e5aad32d515c96b528df5 (diff) | |
download | cpython-56d25add07093701c4827ea3a46b7025d9030f3c.zip cpython-56d25add07093701c4827ea3a46b7025d9030f3c.tar.gz cpython-56d25add07093701c4827ea3a46b7025d9030f3c.tar.bz2 |
Improve asyncio.loop.call_soon() documentation (GH-20883)
* Add a glossary entry for the term "callback"
* Link to it in loop.call_soon() and in the "Concurrency and Multithreading" section
Co-authored-by: Kyle Stanley <aeros167@gmail.com>
(cherry picked from commit a16d6970496cae5ecab5aaea2b416a4b77527cc2)
Co-authored-by: Roger Iyengar <ri@rogeriyengar.com>
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/asyncio-dev.rst | 2 | ||||
-rw-r--r-- | Doc/library/asyncio-eventloop.rst | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/asyncio-dev.rst b/Doc/library/asyncio-dev.rst index 101e781..0d302ea 100644 --- a/Doc/library/asyncio-dev.rst +++ b/Doc/library/asyncio-dev.rst @@ -73,7 +73,7 @@ event loop, no other Tasks can run in the same thread. When a Task executes an ``await`` expression, the running Task gets suspended, and the event loop executes the next Task. -To schedule a callback from a different OS thread, the +To schedule a :term:`callback` from another OS thread, the :meth:`loop.call_soon_threadsafe` method should be used. Example:: loop.call_soon_threadsafe(callback, *args) diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index 9022993..32bc219 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -179,8 +179,8 @@ Scheduling callbacks .. method:: loop.call_soon(callback, *args, context=None) - Schedule a *callback* to be called with *args* arguments at - the next iteration of the event loop. + Schedule the *callback* :term:`callback` to be called with + *args* arguments at the next iteration of the event loop. Callbacks are called in the order in which they are registered. Each callback will be called exactly once. |