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 hashes)
Built Distribution
Close
Hashes for aiorecycle-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cdc2faf7134321242fac5e84b31e4e610c7b9f2eda6a0471fa2bf2931ce58d7 |
|
MD5 | d3cff95eebab1395a4c846553b044d3b |
|
BLAKE2b-256 | 11774c3459f62928b73508bcd38f2cc5c1a4fedddd728966f0c8320184d718a7 |