Skip to content

mpyatishev/aiorecycle

Repository files navigation

aiorecycle

https://travis-ci.com/mpyatishev/aiorecycle.svg?branch=master

A decorator to recycle tasks in the event loop

Installation

pip install aiorecycle

Usage example

import asyncio

import aiorecycle


@aiorecycle.cycle()
async def task():
    if asyncio.get_event_loop().time() % 2 == 0:
        print('make some periodic work')


async def main():
    await task()
    await asyncio.sleep(3)  # emulate very important work


if __name__ == "__main__":
   asyncio.run(main())

License

aiorecycle library is offered under Apache 2 license.

About

Decorator to recycle tasks in the event loop

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages