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 == 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
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.2.tar.gz
(1.9 kB
view hashes)
Built Distribution
Close
Hashes for aiorecycle-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae3509d25291abc523afbdb3c6e5bb2eb8fa05679a92dc59df585b62bf2702a5 |
|
MD5 | 9b31c89564eae353b09f28f97baaf8c0 |
|
BLAKE2b-256 | e719f63cf145a8328a6043144122637f1f3ab1827570ff1975843a4657d5885c |