diff options
-rw-r--r-- | Doc/library/asyncio-eventloop.rst | 12 | ||||
-rw-r--r-- | 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 8706b41..ed38512 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 <asyncio-hello-world-coroutine>`. + The :ref:`Hello World coroutine <asyncio-hello-world-coroutine>` example + uses a :ref:`coroutine <coroutine>`. Example: Set signal handlers for SIGINT and SIGTERM diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index e7c316d..8c4d790 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 <asyncio-hello-world-callback>`. - + The :ref:`Hello World with a callback <asyncio-hello-world-callback>` + example uses a callback scheduled by the :meth:`BaseEventLoop.call_soon` + method. Example: Chain coroutines ^^^^^^^^^^^^^^^^^^^^^^^^^ |