summaryrefslogtreecommitdiffstats
path: root/Doc/library/asyncio-policy.rst
diff options
context:
space:
mode:
authorElvis Pranskevichus <elvis@magic.io>2018-09-17 23:16:44 (GMT)
committerYury Selivanov <yury@magic.io>2018-09-17 23:16:44 (GMT)
commit1fa2ec49bec50bea1847b558b883c5c904334734 (patch)
tree41171f74e1a202048b6fad10295bacde5940dc52 /Doc/library/asyncio-policy.rst
parent3085534c398e6b181e7a9ac0cb9c80f3c670f2b9 (diff)
downloadcpython-1fa2ec49bec50bea1847b558b883c5c904334734.zip
cpython-1fa2ec49bec50bea1847b558b883c5c904334734.tar.gz
cpython-1fa2ec49bec50bea1847b558b883c5c904334734.tar.bz2
bpo-33649: A copy-editing pass on asyncio documentation (GH-9376)
Diffstat (limited to 'Doc/library/asyncio-policy.rst')
-rw-r--r--Doc/library/asyncio-policy.rst23
1 files changed, 11 insertions, 12 deletions
diff --git a/Doc/library/asyncio-policy.rst b/Doc/library/asyncio-policy.rst
index 61727d4..42f936d 100644
--- a/Doc/library/asyncio-policy.rst
+++ b/Doc/library/asyncio-policy.rst
@@ -7,9 +7,9 @@
Policies
========
-An event loop policy, a global per-process object, controls
-management of the event loop. Each event loop has a default
-policy, which can be changed and customized using the API.
+An event loop policy is a global per-process object that controls
+the management of the event loop. Each event loop has a default
+policy, which can be changed and customized using the policy API.
A policy defines the notion of *context* and manages a
separate event loop per context. The default policy
@@ -20,11 +20,11 @@ By using a custom event loop policy, the behavior of
:func:`new_event_loop` functions can be customized.
Policy objects should implement the APIs defined
-in the abstract base class :class:`AbstractEventLoopPolicy`.
+in the :class:`AbstractEventLoopPolicy` abstract base class.
-Access the Policy
-=================
+Getting and Setting the Policy
+==============================
The following functions can be used to get and set the policy
for the current process:
@@ -111,14 +111,14 @@ Process Watchers
A process watcher allows customization of how an event loop monitors
child processes on Unix. Specifically, the event loop needs to know
-when a child process has finished its execution.
+when a child process has exited.
In asyncio, child processes are created with
:func:`create_subprocess_exec` and :meth:`loop.subprocess_exec`
functions.
-asyncio defines an abstract base class :class:`AbstractChildWatcher`
-that child watchers should implement, and has two different
+asyncio defines the :class:`AbstractChildWatcher` abstract base class,
+which child watchers should implement, and has two different
implementations: :class:`SafeChildWatcher` (configured to be used
by default) and :class:`FastChildWatcher`.
@@ -141,8 +141,7 @@ implementation used by the asyncio event loop:
.. note::
Third-party event loops implementations might not support
custom child watchers. For such event loops, using
- :func:`set_child_watcher` might have no effect or even can
- be prohibited.
+ :func:`set_child_watcher` might be prohibited or have no effect.
.. class:: AbstractChildWatcher
@@ -155,7 +154,7 @@ implementation used by the asyncio event loop:
another callback for the same process replaces the previous
handler.
- *callback* callable must be thread-safe.
+ The *callback* callable must be thread-safe.
.. method:: remove_child_handler(pid)