Skip to main content

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


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)

Uploaded Source

Built Distribution

acron-0.1.3-py3-none-any.whl (5.0 kB view hashes)

Uploaded Python 3

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