From 6888b96cee44364f5414b0e4dbfc69dba8b639b4 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sat, 11 Oct 2014 16:15:58 +0200 Subject: [PATCH] asyncio doc: cleanup Hello World examples --- Doc/library/asyncio-eventloop.rst | 12 ++++++++---- Doc/library/asyncio-task.rst | 5 +++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index 8706b41ff4..ed38512080 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -633,13 +633,16 @@ Handle Cancel the call. +Event loop examples +=================== .. _asyncio-hello-world-callback: -Example: Hello World (callback) -------------------------------- +Hello World with a callback +--------------------------- -Print ``Hello World`` every two seconds, using a callback:: +Print ``"Hello World"`` every two seconds using a callback scheduled by the +:meth:`BaseEventLoop.call_soon` method:: import asyncio @@ -656,7 +659,8 @@ Print ``Hello World`` every two seconds, using a callback:: .. seealso:: - :ref:`Hello World example using a coroutine `. + The :ref:`Hello World coroutine ` example + uses a :ref:`coroutine `. Example: Set signal handlers for SIGINT and SIGTERM diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index e7c316df9e..8c4d790eac 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -98,8 +98,9 @@ Print ``"Hello World"`` every two seconds using a coroutine:: .. seealso:: - :ref:`Hello World example using a callback `. - + The :ref:`Hello World with a callback ` + example uses a callback scheduled by the :meth:`BaseEventLoop.call_soon` + method. Example: Chain coroutines ^^^^^^^^^^^^^^^^^^^^^^^^^ -- 2.40.0