2
2
Hello World
3
3
+++++++++++
4
4
5
- This is a series of examples showing the basics of how write :term: ` coroutines
6
- <coroutine> ` and
7
- schedule them in the asyncio :term: `event loop <event loop> `.
5
+ This is a series of examples showing the basics of how to write
6
+ :term: ` coroutines <coroutine> ` and schedule them in the asyncio
7
+ :term: `event loop <event loop> `.
8
8
9
9
Simple coroutine
10
10
----------------
11
11
12
- Example using the :py:meth: `asyncio.BaseEventLoop.run_until_complete ` method to
13
- schedule a
14
- simple function that will wait one second, print ' hello' and then finish.
12
+ This example uses the :py:meth: `asyncio.BaseEventLoop.run_until_complete `
13
+ method to schedule a simple function that will wait one second, print
14
+ `` hello `` and then finish.
15
15
16
- Because it is launched with `run_until_complete `, the :term: ` event loop <event
17
- loop> ` itself
16
+ Because it is launched with :py:meth: `run_until_complete `,
17
+ the :term: ` event loop <event loop> ` itself
18
18
will terminate once the :term: `coroutine <coroutine> ` is completed.
19
19
20
20
.. literalinclude :: examples/hello_world.py
@@ -23,11 +23,11 @@ will terminate once the :term:`coroutine <coroutine>` is completed.
23
23
Creating tasks
24
24
--------------
25
25
26
- This second example show how you can schedule multiple :term: `coroutines
26
+ This second example shows how you can schedule multiple :term: `coroutines
27
27
<coroutine> ` in the
28
28
event loop, and then run the :term: `event loop <event loop> `.
29
29
30
- Notice that this example will print ' second_hello' before ' first_hello' ,
30
+ Notice that this example will print `` second_hello `` before `` first_hello `` ,
31
31
as the first :term: `task <task> ` scheduled waits longer that the second one
32
32
before printing.
33
33
0 commit comments