asyncio crontab utils
Project description
async_cron
this repo is influenced by schedule.
we supply a async scheduler and async function support
you can easily integrate this lib to you async program,with no blocking
Install
pip install async_cron
Usage examples
All you need is a loop, then enjoy. you can refer to examples, as well.
Consumer:
import asyncio
from async_cron.job import CronJob
from async_cron.schedule import Scheduler
async def test(*args, **kwargs):
print(args, kwargs)
def tt(*args, **kwargs):
print(args, kwargs)
msh = Scheduler()
myjob = CronJob(name='test').every(5).second.go(test, (1, 2, 3), name=123)
# tolerance means if now - at_exact_time <= tolerance,this job will still be applied
job2 = CronJob(name='tt', tolerance=100).at(
"2019-01-15 16:12").go(tt, (5), age=99)
# msh.add_job(myjob)
msh.add_job(job2)
loop = asyncio.get_event_loop()
loop.run_until_complete(msh.start())
License
The async_cron is offered under MIT 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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for async_cron-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f5873b2bcbac429cef678ab6b622be202abafe77e7ebaabd267cfa728965672 |
|
MD5 | 4b1390e57dcc49bf66597f0c3e40eb2b |
|
BLAKE2b-256 | ba649bbb2e7df467dd4c1685179c247d6d67d40032c017dec60b2c79c9f6a216 |