Lightweight scheduler
Project description
Lightweight scheduler for python asyncio
Based on croniter to support the crontab syntax.
import asyncio
from acron.scheduler import Scheduler, Job
async def do_the_thing():
print('Doing the thing')
async def run_jobs_forever():
stop = asyncio.Event()
do_thing = Job(
name="Do the thing",
schedule="0/1 * * * *",
func=do_the_thing,
)
async with Scheduler() as scheduler:
await scheduler.update_jobs({do_thing})
await stop.wait()
if __name__ == '__main__':
try:
asyncio.run(run_jobs_forever())
except KeyboardInterrupt:
print('Bye.')
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
acron-0.1.3.tar.gz
(5.0 kB
view hashes)
Built Distribution
acron-0.1.3-py3-none-any.whl
(5.0 kB
view hashes)