Skip to main content

A decorator to recycle tasks in the event loop

Project description

https://travis-ci.com/mpyatishev/aiorecycle.svg?branch=master https://codecov.io/gh/mpyatishev/aiorecycle/branch/master/graph/badge.svg https://img.shields.io/pypi/v/aiorecycle.svg

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for aiorecycle, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size aiorecycle-0.0.2-py3-none-any.whl (6.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size aiorecycle-0.0.2.tar.gz (1.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page