diff options
author | Ray Holder <ray@blacklocus.com> | 2013-01-21 18:49:12 -0600 |
---|---|---|
committer | Ray Holder <ray@blacklocus.com> | 2013-01-21 18:49:12 -0600 |
commit | f913c44737febac73b8c752195543456fb2743d1 (patch) | |
tree | b5de0fa80c7408b4a7d9038d603d9cdbfc0b0106 /README.rst | |
parent | fd4d0e8470a95df48ed0d09f8c23a0054b5bd97d (diff) | |
download | retrying-f913c44737febac73b8c752195543456fb2743d1.tar.gz |
flushing out the README.rst a bit more
Diffstat (limited to 'README.rst')
-rw-r--r-- | README.rst | 67 |
1 files changed, 60 insertions, 7 deletions
@@ -1,16 +1,69 @@ -Retrying Module -================================ +Retrying, to retry all the things +========================= -Retry any arbitrary function conditionally via a @retry decorator. -Usage ------ -TODO +.. image:: https://travis-ci.org/rholder/retrying.png?branch=master + :target: https://travis-ci.org/rholder/retrying + +Retrying is an Apache 2.0 licensed general-purpose retrying library, written in +Python, to simplify the task of adding retry behavior to just about anything. + + +The simplest use case is retrying a flaky function whenever an Exception occurs +until a value is returned. + +.. code-block:: python + + import random + from retrying import retry + + @retry + def do_something_unreliable(): + if random.randint(0, 10) > 1: + raise IOError("Broken sauce, everything is hosed!!!111one") + else: + return "Awesome sauce!" + + print do_something_unreliable() + +TODO flush out more examples + + +Features +-------- + +- Generic Decorator API +- Specify stop condition (i.e. limit by number of attempts) +- Specify wait condition (i.e. exponential backoff sleeping between attempts) +- Customize retrying on Exceptions +- Customize retrying on expected returned result + Installation ------------ -Installing the retrying module is simple:: +To install retrying, simply: + +.. code-block:: bash $ pip install retrying +Or, if you absolutely must: + +.. code-block:: bash + + $ easy_install retrying + +But, you might regret that later. + + +Contribute +---------- + +#. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug. +#. Fork `the repository`_ on GitHub to start making your changes to the **master** branch (or branch off of it). +#. Write a test which shows that the bug was fixed or that the feature works as expected. +#. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to AUTHORS_. + +.. _`the repository`: http://github.com/rholder/retrying +.. _AUTHORS: https://github.com/rholder/retrying/blob/master/AUTHORS.rst |