Skip to content

Improve asyncio.loop.call_soon() documentation #20883

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jun 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Doc/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ Glossary
A list of bytecode instructions can be found in the documentation for
:ref:`the dis module <bytecodes>`.

callback
A subroutine function which is passed as an argument to be executed at
some point in the future.

class
A template for creating user-defined objects. Class definitions
normally contain method definitions which operate on instances of the
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/asyncio-dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/asyncio-eventloop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation for asyncio.create_task() says "Wrap the coro coroutine" instead of "Wrap a coro coroutine."

*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.
Expand Down