All Projects → aohan237 → async_cron

aohan237 / async_cron

Licence: MIT license
crontab for python,with asyncio

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to async cron

Ncrontab
Crontab for .NET
Stars: ✭ 566 (+2360.87%)
Mutual labels:  schedule, crontab
croner
Trigger functions and/or evaluate cron expressions in JavaScript. No dependencies. Most features. All environments.
Stars: ✭ 169 (+634.78%)
Mutual labels:  schedule, crontab
watchman
📆 更夫(watchman)是一款可视化的定时任务配置 Web 工具,麻麻不用担心我漏掉任何更新啦!
Stars: ✭ 40 (+73.91%)
Mutual labels:  schedule, crontab
Hproxy
hproxy - Asynchronous IP proxy pool, aims to make getting proxy as convenient as possible.(异步爬虫代理池)
Stars: ✭ 62 (+169.57%)
Mutual labels:  schedule, asyncio
Crontab
Parse Cron Expressions, Compose Cron Expression Strings and Caluclate Execution Dates.
Stars: ✭ 62 (+169.57%)
Mutual labels:  schedule, crontab
serverless-local-schedule
⚡️🗺️⏰ Schedule AWS CloudWatch Event based invocations in local time(with DST support!)
Stars: ✭ 68 (+195.65%)
Mutual labels:  schedule, crontab
Owllook
owllook-小说搜索引擎
Stars: ✭ 2,163 (+9304.35%)
Mutual labels:  schedule, asyncio
delay-timer
Time-manager of delayed tasks. Like crontab, but synchronous asynchronous tasks are possible scheduling, and dynamic add/cancel/remove is supported.
Stars: ✭ 257 (+1017.39%)
Mutual labels:  schedule, crontab
aws-tag-sched-ops
Retired, please see https://github.com/sqlxpert/lights-off-aws
Stars: ✭ 24 (+4.35%)
Mutual labels:  schedule
kube-install
一鍵安裝部署高可用的多kubernetes集羣(二進位離線方式),支持定時安裝、添加與銷毀node、銷毀與修復master、一鍵卸載集羣等。One click offline installation of highly available multiple kubernetes cluster, supports schedule installation, addition of nodes, rebuild of kubernetes master, and uninstallation of clusters.
Stars: ✭ 336 (+1360.87%)
Mutual labels:  schedule
aria2-bt-tracker
auto update aria2 bt-tracker
Stars: ✭ 35 (+52.17%)
Mutual labels:  crontab
CloudSimPy
CloudSimPy: Datacenter job scheduling simulation framework
Stars: ✭ 144 (+526.09%)
Mutual labels:  schedule
OPoster
Scheduling Platform for Social Media Networks. Powered by Orienteer
Stars: ✭ 31 (+34.78%)
Mutual labels:  schedule
DNTScheduler.Core
DNTScheduler.Core is a lightweight ASP.NET Core's background tasks runner and scheduler
Stars: ✭ 44 (+91.3%)
Mutual labels:  schedule
socketwrapper
Async/Sync networking library including UDP, TCP and TLS/TCP socket classes written in C++ 17.
Stars: ✭ 33 (+43.48%)
Mutual labels:  asyncio
xiaoniu cron
基于APScheduler二次开发,支持集群,可视化,API动态调用等等。BUG及时通知到微信,网页等等。
Stars: ✭ 53 (+130.43%)
Mutual labels:  crontab
angular-gantt-schedule-timeline-calendar-example
Angular gantt-schedule-timeline-calendar usage example
Stars: ✭ 15 (-34.78%)
Mutual labels:  schedule
tinkoff-api
Python Tinkoff API client for asyncio and humans
Stars: ✭ 60 (+160.87%)
Mutual labels:  asyncio
react-gantt-schedule-timeline-calendar
React Gantt Schedule Timeline Calendar component wrapper for gantt-schedule-timeline-calendar [ react gantt, gantt, react gantt chart, react schedule, react timeline, react calendar, gantt, schedule, scheduler, timeline, calendar, react gantt chart ]
Stars: ✭ 47 (+104.35%)
Mutual labels:  schedule
node-cron-expression
Declarative functional cron expression builder
Stars: ✭ 17 (-26.09%)
Mutual labels:  crontab

async_cron

Downloads PyPI version

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


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(locale="zh_CN")
myjob = CronJob(name='test', run_total=3).every(
    5).second.go(test, (1, 2, 3), name=123)
job2 = CronJob(name='exact', tolerance=100).at(
    "2019-01-15 16:12").go(tt, (5), age=99)
job3 = CronJob(name='very_hour').every().hour.at(
    ":44").go(tt, (5), age=99)

job3 = CronJob(name='hour').every().hour.at(
    ":00").go(tt, (5), age=99)
job4 = CronJob(name='minute').every(1).minute.go(tt, (5), age=99)
job5 = CronJob(name='weekday').weekday(2).at("11:18").go(tt, (5), age=99)
job6 = CronJob(name='monthday').monthday(16).at("11:22").go(tt, (5), age=99)
job7 = CronJob(name='monthday').every(5).monthday(
    16).at("11:22").go(tt, (5), age=99)


msh.add_job(myjob)
msh.add_job(job2)
msh.add_job(job3)
msh.add_job(job4)
msh.add_job(job5)
msh.add_job(job6)
msh.add_job(job7)

# jobload is only a special job,who gen jobs from config
# below means, this job load will check every 1 second for cron updates
# if any updates found,new job will be add to scheduler
# you dont have the direct way to delete jobs
# but you can modify the crons total_times to 0 or 1 to delete it
# by default,FileJobLoader use MultiThread,you can use MultiProcess by add
# thread=False

f_cron = FileJobLoader(name='f_cron', file_path='t_cron', log_path='.',thread=False)

fjob = CronJob(name='fjob', run_total=1).every(
    1).second.go(f_cron.run, msh)

msh.add_job(fjob)


loop = asyncio.get_event_loop()

try:
    loop.run_until_complete(msh.start())
except KeyboardInterrupt:
    print('exit')

cron file useage:

parameter separate by blank.in item separate by comma

cron name job env run_times
*/1,*,*,*,* test /bin/python,tt.py aa=123,bb=345 10

example as follow:

common cron

*/1,*,*,*,* test /bin/python,tt.py aa=123,bb=345 1

delete cron */1,*,*,*,* test /bin/python,tt.py aa=123,bb=345 0

cron only support: *,10,*/10 format. which fulfills mostly screen

License

The async_cron is offered under MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].