Skip to content
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
20 changes: 16 additions & 4 deletions Doc/library/asyncio-api-index.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.. currentmodule:: asyncio


=====================
High-level APIs Index
=====================
====================
High-level API Index
====================

This page lists all high-level async/await enabled asyncio APIs.

Expand All @@ -16,6 +16,7 @@ await on multiple things with timeouts.

.. list-table::
:widths: 50 50
:class: full-width-table

* - :func:`run`
- Create event loop, run a coroutine, close the loop.
Expand All @@ -36,7 +37,7 @@ await on multiple things with timeouts.
- Shield from cancellation.

* - ``await`` :func:`wait`
- Monitor for completeness.
- Monitor for completion.

* - :func:`current_task`
- Return the current Task.
Expand All @@ -47,6 +48,12 @@ await on multiple things with timeouts.
* - :class:`Task`
- Task object.

* - :func:`run_coroutine_threadsafe`
- Schedule a coroutine from another OS thread.

* - ``for in`` :func:`as_completed`
- Monitor for completion with a ``for`` loop.


.. rubric:: Examples

Expand All @@ -72,6 +79,7 @@ implement connection pools, and pub/sub patterns.

.. list-table::
:widths: 50 50
:class: full-width-table

* - :class:`Queue`
- A FIFO queue.
Expand All @@ -98,6 +106,7 @@ Utilities to spawn subprocesses and run shell commands.

.. list-table::
:widths: 50 50
:class: full-width-table

* - ``await`` :func:`create_subprocess_exec`
- Create a subprocess.
Expand All @@ -121,6 +130,7 @@ High-level APIs to work with network IO.

.. list-table::
:widths: 50 50
:class: full-width-table

* - ``await`` :func:`open_connection`
- Establish a TCP connection.
Expand Down Expand Up @@ -156,6 +166,7 @@ Threading-like synchronization primitives that can be used in Tasks.

.. list-table::
:widths: 50 50
:class: full-width-table

* - :class:`Lock`
- A mutex lock.
Expand Down Expand Up @@ -186,6 +197,7 @@ Exceptions

.. list-table::
:widths: 50 50
:class: full-width-table


* - :exc:`asyncio.TimeoutError`
Expand Down
14 changes: 8 additions & 6 deletions Doc/library/asyncio-eventloop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ Availability: UNIX.
Executing code in thread or process pools
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. method:: loop.run_in_executor(executor, func, \*args)
.. coroutinemethod:: loop.run_in_executor(executor, func, \*args)

Arrange for a *func* to be called in the specified executor.

Expand Down Expand Up @@ -1405,7 +1405,7 @@ need to be written this way; consider using high-level functions
like :func:`asyncio.run`.


.. _asyncio-hello-world-callback:
.. _asyncio_example_lowlevel_helloworld:

Hello World with call_soon()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -1438,7 +1438,7 @@ event loop::
example created with a coroutine and the :func:`run` function.


.. _asyncio-date-callback:
.. _asyncio_example_call_later:

Display the current date with call_later()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -1475,7 +1475,7 @@ during 5 seconds, and then stops the event loop::
created with a coroutine and the :func:`run` function.


.. _asyncio-watch-read-event:
.. _asyncio_example_watch_fd:

Watch a file descriptor for read events
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -1518,15 +1518,17 @@ Wait until a file descriptor received some data using the

.. seealso::

* A similar :ref:`example <asyncio-register-socket>`
* A similar :ref:`example <asyncio_example_create_connection>`
using transports, protocols, and the
:meth:`loop.create_connection` method.

* Another similar :ref:`example <asyncio-register-socket-streams>`
* Another similar :ref:`example <asyncio_example_create_connection-streams>`
using the high-level :func:`asyncio.open_connection` function
and streams.


.. _asyncio_example_unix_signals:

Set signal handlers for SIGINT and SIGTERM
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
2 changes: 2 additions & 0 deletions Doc/library/asyncio-future.rst
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ Future Object
.. versionadded:: 3.7


.. _asyncio_example_future:

This example creates a Future object, creates and schedules an
asynchronous Task to set result for the Future, and waits until
the Future has a result::
Expand Down
Loading