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 all commits
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
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: python
python: 3.6
cache: pip

install: python3 -m pip install -U pip -r requirements.txt

script:
- sphinx-build -n -W -q -b html -d _build/doctrees . _build/html
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
9 changes: 9 additions & 0 deletions getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,34 @@ All platforms with ``conda``
* Create a new Python 3.5 environment (named ``aio35``, use a different
if you like)::

.. highlight:: bash

conda create -n aio35 python=3.5

* Activate it.
Linux and OS X::

.. highlight:: bash

$ source activate aio35

Windows::

.. highlight:: bash

$ source activate aio35

* Install ``aiohttp``::

.. highlight:: bash

$(aio35) pip install aiohttp

Platform specific
-----------------

.. would be good to have some word about installing on Windows

* Windows: The easiest way to use Python 3.5 would be to use a package manager
such as conda. See the installation instructions above.
* Mac OS X: Install `Homebrew </usr/bin/ruby -e "$(curl -fsSL
Expand Down
5 changes: 3 additions & 2 deletions glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ Glossary

future
It's like a mailbox where you can subscribe to receive a result when it
will be done. More details in `official documentation
will be done. More details in `official future documentation
<https://docs.python.org/3/library/asyncio-task.html#future>`_

task
It represents the execution of a coroutine and take care the result in a
future. More details in `official documentation
future. More details in `official task documentation
<https://docs.python.org/3/library/asyncio-task.html#task>`_

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