A decorator to recycle tasks in the event loop
Project description
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:
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
Release history Release notifications | RSS feed
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.1.tar.gz
(1.9 kB
view details)
Built Distribution
File details
Details for the file aiorecycle-0.0.1.tar.gz
.
File metadata
- Download URL: aiorecycle-0.0.1.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.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.5rc1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 425c0ca0d6f4232d7226313db456b5f5cfbffc872eb74f49e7669533f6e1e58a |
|
MD5 | 3988dd341b6dcd9a2b386c2f4869175c |
|
BLAKE2b-256 | 46a7068c7ba3e0cc65aeb6dded632b8ffacf5a49a2f669ba5442e2c6c07e5b59 |
File details
Details for the file aiorecycle-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: aiorecycle-0.0.1-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.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.5rc1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cdc2faf7134321242fac5e84b31e4e610c7b9f2eda6a0471fa2bf2931ce58d7 |
|
MD5 | d3cff95eebab1395a4c846553b044d3b |
|
BLAKE2b-256 | 11774c3459f62928b73508bcd38f2cc5c1a4fedddd728966f0c8320184d718a7 |