Skip to content
This repository was archived by the owner on May 31, 2021. It is now read-only.

Commit 87f8d04

Browse files
authored
Merge pull request #16 from orsenthil/master
* Fix the run_in_thread example, and minor fixes.
2 parents 5ddafac + 87c0a42 commit 87f8d04

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

examples/run_in_thread.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import asyncio
22

3+
34
def 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

1314
loop = asyncio.get_event_loop()
14-
loop.run_until_complete(main())
15+
loop.run_until_complete(main(loop))
1516
loop.close()

examples/synchronous_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def get_encoding(http_response):
1919

2020

2121
def 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
"""

index.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Asyncio Documentation
33
+++++++++++++++++++++
44

55
Chapter 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

2020
Chapter 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

why_asyncio.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
++++++++++++++++++
1+
++++++++++++++++
22
Why use asyncio?
3-
++++++++++++++++++
3+
++++++++++++++++
44

55
Why asynchronous programming?
66
=============================

0 commit comments

Comments
 (0)