Skip to content

Commit 394374e

Browse files
authored
bpo-33649: Add low-level APIs index. (GH-9364)
1 parent c6fd1c1 commit 394374e

10 files changed

+571
-31
lines changed

Doc/library/asyncio-api-index.rst

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
.. currentmodule:: asyncio
22

33

4-
=====================
5-
High-level APIs Index
6-
=====================
4+
====================
5+
High-level API Index
6+
====================
77

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

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

1717
.. list-table::
1818
:widths: 50 50
19+
:class: full-width-table
1920

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

3839
* - ``await`` :func:`wait`
39-
- Monitor for completeness.
40+
- Monitor for completion.
4041

4142
* - :func:`current_task`
4243
- Return the current Task.
@@ -47,6 +48,12 @@ await on multiple things with timeouts.
4748
* - :class:`Task`
4849
- Task object.
4950

51+
* - :func:`run_coroutine_threadsafe`
52+
- Schedule a coroutine from another OS thread.
53+
54+
* - ``for in`` :func:`as_completed`
55+
- Monitor for completion with a ``for`` loop.
56+
5057

5158
.. rubric:: Examples
5259

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

7380
.. list-table::
7481
:widths: 50 50
82+
:class: full-width-table
7583

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

99107
.. list-table::
100108
:widths: 50 50
109+
:class: full-width-table
101110

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

122131
.. list-table::
123132
:widths: 50 50
133+
:class: full-width-table
124134

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

157167
.. list-table::
158168
:widths: 50 50
169+
:class: full-width-table
159170

160171
* - :class:`Lock`
161172
- A mutex lock.
@@ -186,6 +197,7 @@ Exceptions
186197

187198
.. list-table::
188199
:widths: 50 50
200+
:class: full-width-table
189201

190202

191203
* - :exc:`asyncio.TimeoutError`

Doc/library/asyncio-eventloop.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@ Availability: UNIX.
980980
Executing code in thread or process pools
981981
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
982982

983-
.. method:: loop.run_in_executor(executor, func, \*args)
983+
.. coroutinemethod:: loop.run_in_executor(executor, func, \*args)
984984

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

@@ -1418,7 +1418,7 @@ need to be written this way; consider using high-level functions
14181418
like :func:`asyncio.run`.
14191419

14201420

1421-
.. _asyncio-hello-world-callback:
1421+
.. _asyncio_example_lowlevel_helloworld:
14221422

14231423
Hello World with call_soon()
14241424
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1451,7 +1451,7 @@ event loop::
14511451
example created with a coroutine and the :func:`run` function.
14521452

14531453

1454-
.. _asyncio-date-callback:
1454+
.. _asyncio_example_call_later:
14551455

14561456
Display the current date with call_later()
14571457
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1488,7 +1488,7 @@ during 5 seconds, and then stops the event loop::
14881488
created with a coroutine and the :func:`run` function.
14891489

14901490

1491-
.. _asyncio-watch-read-event:
1491+
.. _asyncio_example_watch_fd:
14921492

14931493
Watch a file descriptor for read events
14941494
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1531,15 +1531,17 @@ Wait until a file descriptor received some data using the
15311531

15321532
.. seealso::
15331533

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

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

15421542

1543+
.. _asyncio_example_unix_signals:
1544+
15431545
Set signal handlers for SIGINT and SIGTERM
15441546
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15451547

Doc/library/asyncio-future.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ Future Object
191191
.. versionadded:: 3.7
192192

193193

194+
.. _asyncio_example_future:
195+
194196
This example creates a Future object, creates and schedules an
195197
asynchronous Task to set result for the Future, and waits until
196198
the Future has a result::

0 commit comments

Comments
 (0)