Skip to content

Commit

Permalink
Improve README.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjrh committed Nov 4, 2017
1 parent 73eb953 commit a3d4f7b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ Here's the big idea (how you use it):
run(main())
This package provides a ``run()`` function as the starting point
of your ``asyncio``-based application.
of your ``asyncio``-based application. The ``run()`` function will
run forever. If you want to shut down when ``main()`` completes, just
call ``loop.stop()`` inside it: that will initiate shutdown.

Why?
----

The ``run()`` function will handle **everything** that normally needs
to be done during the shutdown sequence of the application. All you
Expand All @@ -64,7 +69,8 @@ again. So, if you use ``aiorun`` this is what **you** need to remember:
- Spawn all your work from a single, starting coroutine
- When a shutdown signal is received, **all** currently-pending tasks
will have ``CancelledError`` raised internally. It's up to you whether
you want to handle this in a ``try/except`` or not.
you want to handle this (inside your coroutines) with
a ``try/except`` or not.
- Try to have executor jobs be shortish, since shutdown will wait for them
to finish. If you need a long-running thread or process tasks, use
a dedicated thread/subprocess and set ``daemon=True`` instead.
Expand Down
2 changes: 1 addition & 1 deletion aiorun.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


__all__ = ['run', 'shutdown_waits_for']
__version__ = '2017.10.5'
__version__ = '2017.11.1'
logger = logging.getLogger('aiorun')


Expand Down

0 comments on commit a3d4f7b

Please sign in to comment.