summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-11-28 12:58:53 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-11-28 12:58:53 (GMT)
commit74210e1e0f7d1682f0bd78d206902fe8cb418136 (patch)
treeca8c8b07395292ac570e931b89e56c6dec2956a4
parentbeeb512fe1d8c502d854d7e27742a7481bccd5c4 (diff)
parent1deee54e0cb0f681779259758a30f4fe142f1477 (diff)
downloadcpython-74210e1e0f7d1682f0bd78d206902fe8cb418136.zip
cpython-74210e1e0f7d1682f0bd78d206902fe8cb418136.tar.gz
cpython-74210e1e0f7d1682f0bd78d206902fe8cb418136.tar.bz2
(Merge 3.4) asyncio doc: reformat event loop policy doc
-rw-r--r--Doc/library/asyncio-eventloops.rst26
1 files changed, 18 insertions, 8 deletions
diff --git a/Doc/library/asyncio-eventloops.rst b/Doc/library/asyncio-eventloops.rst
index b871083..e891ed1 100644
--- a/Doc/library/asyncio-eventloops.rst
+++ b/Doc/library/asyncio-eventloops.rst
@@ -150,6 +150,7 @@ loop per thread that interacts with :mod:`asyncio`. The module-level functions
:func:`get_event_loop` and :func:`set_event_loop` provide convenient access to
event loops managed by the default policy.
+
Event loop policy interface
---------------------------
@@ -157,22 +158,31 @@ An event loop policy must implement the following interface:
.. class:: AbstractEventLoopPolicy
+ Event loop policy.
+
.. method:: get_event_loop()
- Get the event loop for the current context. Returns an event loop object
- implementing the :class:`BaseEventLoop` interface, or raises an exception in case
- no event loop has been set for the current context and the current policy
- does not specify to create one. It should never return ``None``.
+ Get the event loop for the current context.
+
+ Returns an event loop object implementing the :class:`BaseEventLoop`
+ interface.
+
+ Raises an exception in case no event loop has been set for the current
+ context and the current policy does not specify to create one. It must
+ never return ``None``.
.. method:: set_event_loop(loop)
- Set the event loop for the current context to *loop*.
+ Set the event loop for the current context to *loop*.
.. method:: new_event_loop()
- Create and return a new event loop object according to this policy's rules.
- If there's need to set this loop as the event loop for the current context,
- :meth:`set_event_loop` must be called explicitly.
+ Create and return a new event loop object according to this policy's
+ rules.
+
+ If there's need to set this loop as the event loop for the current
+ context, :meth:`set_event_loop` must be called explicitly.
+
Access to the global loop policy
--------------------------------