Skip to content

hellysmile/async_retrying

Repository files navigation

async_retrying

info:Simple retrying for asyncio

Installation

pip install async_retrying

Usage

import asyncio

from async_retrying import retry

counter = 0

@retry
@asyncio.coroutine
def fn():
    global counter

    counter += 1

    if counter == 1:
        raise RuntimeError

@asyncio.coroutine
def main():
    yield from fn()

loop = asyncio.get_event_loop()

loop.run_until_complete(main())

assert counter == 2

loop.close()

Python 3.3+ is required

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages