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.

Source Distribution

aiorecycle-0.0.2.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

aiorecycle-0.0.2-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file aiorecycle-0.0.2.tar.gz.

File metadata

  • Download URL: aiorecycle-0.0.2.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.6

File hashes

Hashes for aiorecycle-0.0.2.tar.gz
Algorithm Hash digest
SHA256 e5cd37a8396f5f75b85166a3bb53a48c40e575a92a4ba1e75f6f37d7a904d376
MD5 612b460b961fd7c6415f3d8488188d00
BLAKE2b-256 874be54f41819ec11e88a59ca20b7af06133cb0ee241c1a19a02dfd5f5bd9baf

See more details on using hashes here.

File details

Details for the file aiorecycle-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: aiorecycle-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.6

File hashes

Hashes for aiorecycle-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ae3509d25291abc523afbdb3c6e5bb2eb8fa05679a92dc59df585b62bf2702a5
MD5 9b31c89564eae353b09f28f97baaf8c0
BLAKE2b-256 e719f63cf145a8328a6043144122637f1f3ab1827570ff1975843a4657d5885c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page