Skip to content

Commit a16d697

Browse files
akindofyogaaeros
andauthored
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>
1 parent c96d00e commit a16d697

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

Doc/glossary.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ Glossary
189189
A list of bytecode instructions can be found in the documentation for
190190
:ref:`the dis module <bytecodes>`.
191191

192+
callback
193+
A subroutine function which is passed as an argument to be executed at
194+
some point in the future.
195+
192196
class
193197
A template for creating user-defined objects. Class definitions
194198
normally contain method definitions which operate on instances of the

Doc/library/asyncio-dev.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ event loop, no other Tasks can run in the same thread. When a Task
7373
executes an ``await`` expression, the running Task gets suspended, and
7474
the event loop executes the next Task.
7575

76-
To schedule a callback from a different OS thread, the
76+
To schedule a :term:`callback` from another OS thread, the
7777
:meth:`loop.call_soon_threadsafe` method should be used. Example::
7878

7979
loop.call_soon_threadsafe(callback, *args)

Doc/library/asyncio-eventloop.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ Scheduling callbacks
191191

192192
.. method:: loop.call_soon(callback, *args, context=None)
193193

194-
Schedule a *callback* to be called with *args* arguments at
195-
the next iteration of the event loop.
194+
Schedule the *callback* :term:`callback` to be called with
195+
*args* arguments at the next iteration of the event loop.
196196

197197
Callbacks are called in the order in which they are registered.
198198
Each callback will be called exactly once.

0 commit comments

Comments
 (0)