Kaydet (Commit) 6d9767fb authored tarafından Carol Willing's avatar Carol Willing Kaydeden (comit) Yury Selivanov

edit async policy doc - second pass (GH-9235)

üst 5b7cbd60
...@@ -11,9 +11,9 @@ An event loop policy, a global per-process object, controls ...@@ -11,9 +11,9 @@ An event loop policy, a global per-process object, controls
management of the event loop. Each event loop has a default management of the event loop. Each event loop has a default
policy, which can be changed and customized using the API. policy, which can be changed and customized using the API.
A policy defines the notion of context and manages a A policy defines the notion of *context* and manages a
separate event loop per context. The default policy separate event loop per context. The default policy
defines context to be the current thread. defines *context* to be the current thread.
By using a custom event loop policy, the behavior of By using a custom event loop policy, the behavior of
:func:`get_event_loop`, :func:`set_event_loop`, and :func:`get_event_loop`, :func:`set_event_loop`, and
...@@ -94,8 +94,8 @@ asyncio ships with the following built-in policies: ...@@ -94,8 +94,8 @@ asyncio ships with the following built-in policies:
The default asyncio policy. Uses :class:`SelectorEventLoop` The default asyncio policy. Uses :class:`SelectorEventLoop`
on both Unix and Windows platforms. on both Unix and Windows platforms.
There is no need to install the default policy manually; asyncio There is no need to install the default policy manually. asyncio
is configured to use it automatically. is configured to use the default policy automatically.
.. class:: WindowsProactorEventLoopPolicy .. class:: WindowsProactorEventLoopPolicy
...@@ -125,7 +125,7 @@ by default) and :class:`FastChildWatcher`. ...@@ -125,7 +125,7 @@ by default) and :class:`FastChildWatcher`.
See also the :ref:`Subprocess and Threads <asyncio-subprocess-threads>` See also the :ref:`Subprocess and Threads <asyncio-subprocess-threads>`
section. section.
The following two functions can be used to customize the watcher The following two functions can be used to customize the child process watcher
implementation used by the asyncio event loop: implementation used by the asyncio event loop:
.. function:: get_child_watcher() .. function:: get_child_watcher()
...@@ -189,7 +189,7 @@ implementation used by the asyncio event loop: ...@@ -189,7 +189,7 @@ implementation used by the asyncio event loop:
handling a big number of processes (*O(n)* each time a handling a big number of processes (*O(n)* each time a
:py:data:`SIGCHLD` is received). :py:data:`SIGCHLD` is received).
asyncio uses this implementation by default. asyncio uses this safe implementation by default.
.. class:: FastChildWatcher .. class:: FastChildWatcher
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment