This repository was archived by the owner on May 31, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
1
import asyncio
2
2
3
+
3
4
def compute_pi (digits ):
4
5
# implementation
5
6
return 3.14
6
7
7
8
8
- async def main ():
9
+ async def main (loop ):
9
10
digits = await loop .run_in_executor (None , compute_pi , 20000 )
10
11
print ("pi: %s" % digits )
11
12
12
13
13
14
loop = asyncio .get_event_loop ()
14
- loop .run_until_complete (main ())
15
+ loop .run_until_complete (main (loop ))
15
16
loop .close ()
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ def get_encoding(http_response):
19
19
20
20
21
21
def get_page (host , port , wait = 0 ):
22
- """Get one page suppling `wait` time.
22
+ """Get one page supplying `wait` time.
23
23
24
24
The path will be build with: `host:port/wait`
25
25
"""
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ Asyncio Documentation
3
3
+++++++++++++++++++++
4
4
5
5
Chapter 1: First steps with asyncio
6
- ====================================
6
+ ===================================
7
7
8
8
.. toctree ::
9
9
:maxdepth: 2
@@ -18,7 +18,7 @@ Chapter 1: First steps with asyncio
18
18
19
19
20
20
Chapter 2: Advanced topics
21
- ===========================
21
+ ==========================
22
22
23
23
.. toctree ::
24
24
:maxdepth: 2
@@ -55,7 +55,6 @@ See also
55
55
* `A Web Crawler With asyncio Coroutines
56
56
<http://aosabook.org/en/500L/a-web-crawler-with-asyncio-coroutines.html> `_
57
57
by A. Jesse Jiryu Davis and Guido van Rossum
58
- * `asyncio.org <http://asyncio.org/ >`_
59
58
* `Writing Redis in Python with asyncio: Part 1
60
59
<http://jamesls.com/writing-redis-in-python-with-asyncio-part-1.html> `_
61
60
by James Saryerwinnie
Original file line number Diff line number Diff line change 1
- ++++++++++++++++++
1
+ ++++++++++++++++
2
2
Why use asyncio?
3
- ++++++++++++++++++
3
+ ++++++++++++++++
4
4
5
5
Why asynchronous programming?
6
6
=============================
You can’t perform that action at this time.
0 commit comments