Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
6888b96c
Commit
6888b96c
authored
Oct 11, 2014
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asyncio doc: cleanup Hello World examples
parent
5121a9ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
Doc/library/asyncio-eventloop.rst
Doc/library/asyncio-eventloop.rst
+8
-4
Doc/library/asyncio-task.rst
Doc/library/asyncio-task.rst
+3
-2
No files found.
Doc/library/asyncio-eventloop.rst
View file @
6888b96c
...
@@ -633,13 +633,16 @@ Handle
...
@@ -633,13 +633,16 @@ Handle
Cancel the call.
Cancel the call.
Event loop examples
===================
.. _asyncio-hello-world-callback:
.. _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
import asyncio
...
@@ -656,7 +659,8 @@ Print ``Hello World`` every two seconds, using a callback::
...
@@ -656,7 +659,8 @@ Print ``Hello World`` every two seconds, using a callback::
.. seealso::
.. 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
Example: Set signal handlers for SIGINT and SIGTERM
...
...
Doc/library/asyncio-task.rst
View file @
6888b96c
...
@@ -98,8 +98,9 @@ Print ``"Hello World"`` every two seconds using a coroutine::
...
@@ -98,8 +98,9 @@ Print ``"Hello World"`` every two seconds using a coroutine::
.. seealso::
.. 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
Example: Chain coroutines
^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment