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 11import asyncio
22
3+
34def compute_pi (digits ):
45 # implementation
56 return 3.14
67
78
8- async def main ():
9+ async def main (loop ):
910 digits = await loop .run_in_executor (None , compute_pi , 20000 )
1011 print ("pi: %s" % digits )
1112
1213
1314loop = asyncio .get_event_loop ()
14- loop .run_until_complete (main ())
15+ loop .run_until_complete (main (loop ))
1516loop .close ()
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ def get_encoding(http_response):
1919
2020
2121def get_page (host , port , wait = 0 ):
22- """Get one page suppling `wait` time.
22+ """Get one page supplying `wait` time.
2323
2424 The path will be build with: `host:port/wait`
2525 """
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ Asyncio Documentation
33+++++++++++++++++++++
44
55Chapter 1: First steps with asyncio
6- ====================================
6+ ===================================
77
88.. toctree ::
99 :maxdepth: 2
@@ -18,7 +18,7 @@ Chapter 1: First steps with asyncio
1818
1919
2020Chapter 2: Advanced topics
21- ===========================
21+ ==========================
2222
2323.. toctree ::
2424 :maxdepth: 2
@@ -55,7 +55,6 @@ See also
5555* `A Web Crawler With asyncio Coroutines
5656 <http://aosabook.org/en/500L/a-web-crawler-with-asyncio-coroutines.html> `_
5757 by A. Jesse Jiryu Davis and Guido van Rossum
58- * `asyncio.org <http://asyncio.org/ >`_
5958* `Writing Redis in Python with asyncio: Part 1
6059 <http://jamesls.com/writing-redis-in-python-with-asyncio-part-1.html> `_
6160 by James Saryerwinnie
Original file line number Diff line number Diff line change 1- ++++++++++++++++++
1+ ++++++++++++++++
22Why use asyncio?
3- ++++++++++++++++++
3+ ++++++++++++++++
44
55Why asynchronous programming?
66=============================
You can’t perform that action at this time.
0 commit comments