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

Create .travis.yml #32

Merged
merged 4 commits into from
Mar 14, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix errors
  • Loading branch information
Mariatta committed Mar 14, 2019
commit 59291dde7c9bbd5484004ff3288c9e320517d091
2 changes: 1 addition & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ['_build/html/_static']

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down
12 changes: 7 additions & 5 deletions hello_world.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ This is a series of examples showing the basics of how to write
Simple coroutine
----------------

This example uses the :py:meth:`asyncio.BaseEventLoop.run_until_complete`
This example uses the :py:meth:`asyncio.AbstractEventLoop.run_until_complete`
method to schedule a simple function that will wait one second, print
``hello`` and then finish.

Because it is launched with :py:meth:`run_until_complete`,
Because it is launched with :py:meth:`asyncio.AbstractEventLoop.run_until_complete`,
the :term:`event loop <event loop>` itself
will terminate once the :term:`coroutine <coroutine>` is completed.

Expand Down Expand Up @@ -49,7 +49,9 @@ all scheduled :term:`tasks <task>` could execute, which results in a warning.

Warning::

Task was destroyed but it is pending!
task: <Task pending coro=<say() done, defined at examples/loop_stop.py:3>
wait_for=<Future pending cb=[Task._wakeup()]>>
.. highlight:: none

Task was destroyed but it is pending!
task: <Task pending coro=<say() done, defined at examples/loop_stop.py:3>
wait_for=<Future pending cb=[Task._wakeup()]>>

12 changes: 12 additions & 0 deletions webscraper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ This is a very simple web server. (See below for the code.)
Its only purpose is to wait for a given amount of time.
Test it by running it from the command line::

.. highlight:: bash

$ python simple_server.py

It will answer like this::
Expand Down Expand Up @@ -125,6 +127,8 @@ difference provides the elapsed run time.

Finally, we can run our client::

.. highlight:: bash

$ python synchronous_client.py

and get this output::
Expand Down Expand Up @@ -254,6 +258,8 @@ This means, we wait until each pages has been retrieved before asking for
the next.
Let's run it from the command-line to see what happens::

.. highlight:: bash

$ async_client_blocking.py
It took 11.06 seconds for a total waiting time of 11.00.
Waited for 1.00 seconds.
Expand Down Expand Up @@ -320,6 +326,8 @@ So, for a list with 100 tasks it would mean:

Let's see if we got any faster::

.. highlight:: bash

$ async_client_nonblocking.py
It took 5.08 seconds for a total waiting time of 11.00.
Waited for 1.00 seconds.
Expand Down Expand Up @@ -359,6 +367,8 @@ The library aiohttp_ allows to write HTTP client and server applications,
using a high-level approach.
Install with::

.. highlight:: bash

$ pip install aiohttp


Expand Down Expand Up @@ -409,6 +419,8 @@ to ``fetch_page()`` as the first argument.

Finally, we run this program::

.. highlight:: bash

$ python aiohttp_client.py
It took 5.04 seconds for a total waiting time of 11.00.
Waited for 1.00 seconds.
Expand Down