All Projects → go-co-op → Gocron

go-co-op / Gocron

Licence: mit
Easy and fluent Go cron scheduling. This is a fork from https://github.com/jasonlvhit/gocron

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Gocron

scheduler
Task Scheduler for Laravel applications. UI from scratch
Stars: ✭ 18 (-97.02%)
Mutual labels:  cron, schedule, scheduler
Crono
A time-based background job scheduler daemon (just like Cron) for Rails
Stars: ✭ 637 (+5.29%)
Mutual labels:  scheduler, cron, schedule
croner
Trigger functions and/or evaluate cron expressions in JavaScript. No dependencies. Most features. All environments.
Stars: ✭ 169 (-72.07%)
Mutual labels:  cron, schedule, scheduler
nodejs-cron-job-must-know
it is an example of running node.js script with every certain period(cron job)
Stars: ✭ 35 (-94.21%)
Mutual labels:  cron, schedule, scheduler
linda
Linda is a simple dispatcher library.
Stars: ✭ 12 (-98.02%)
Mutual labels:  cron, schedule, scheduler
Automation-using-Shell-Scripts
Development Automation using Shell Scripting.
Stars: ✭ 41 (-93.22%)
Mutual labels:  cron, scheduler
krolib
Magic library and DSL to handle complex schedules
Stars: ✭ 19 (-96.86%)
Mutual labels:  schedule, scheduler
schedule-rs
An in-process scheduler for periodic jobs. Schedule lets you run Rust functions on a cron-like schedule.
Stars: ✭ 93 (-84.63%)
Mutual labels:  cron, schedule
rhythm
Time-based job scheduler for Apache Mesos
Stars: ✭ 30 (-95.04%)
Mutual labels:  cron, scheduler
jquery-schedule
jQuery Schedule
Stars: ✭ 53 (-91.24%)
Mutual labels:  schedule, scheduler
asparagus
An easy to use task scheduler for distributed systems
Stars: ✭ 14 (-97.69%)
Mutual labels:  cron, scheduler
coo
Schedule Twitter updates with easy
Stars: ✭ 44 (-92.73%)
Mutual labels:  schedule, scheduler
sidecloq
Recurring / Periodic / Scheduled / Cron job extension for Sidekiq
Stars: ✭ 81 (-86.61%)
Mutual labels:  cron, schedule
ckron
🐋 A cron-like job scheduler for docker
Stars: ✭ 37 (-93.88%)
Mutual labels:  cron, scheduler
gymbox-bot
Simplify the booking of a gymbox class.
Stars: ✭ 21 (-96.53%)
Mutual labels:  cron, schedule
cron-schedule
A zero-dependency cron parser and scheduler for Node.js, Deno and the browser.
Stars: ✭ 28 (-95.37%)
Mutual labels:  cron, schedule
php-cron-expr
Ultra lightweight, Dependency free and Super Fast Cron Expression parser for PHP
Stars: ✭ 42 (-93.06%)
Mutual labels:  cron, scheduler
Quartznet
Quartz Enterprise Scheduler .NET
Stars: ✭ 4,825 (+697.52%)
Mutual labels:  scheduler, cron
angular-gantt-schedule-timeline-calendar-example
Angular gantt-schedule-timeline-calendar usage example
Stars: ✭ 15 (-97.52%)
Mutual labels:  schedule, scheduler
watchman
📆 更夫(watchman)是一款可视化的定时任务配置 Web 工具,麻麻不用担心我漏掉任何更新啦!
Stars: ✭ 40 (-93.39%)
Mutual labels:  cron, schedule

gocron: A Golang Job Scheduling Package.

CI State Go Report Card Go Doc

gocron is a Golang job scheduling package which lets you run Go functions periodically at pre-determined interval using a simple, human-friendly syntax.

gocron is a Golang implementation of the Ruby module clockwork and the Python job scheduling package schedule.

See also these two great articles:

If you want to chat, you can find us at Slack!

Concepts

  • Scheduler: The scheduler tracks all the jobs assigned to it and makes sure they are passed to the executor when ready to be run. The scheduler is able to manage overall aspects of job behavior like limiting how many jobs are running at one time.
  • Job: The job is simply aware of the task (go function) it's provided and is therefore only able to perform actions related to that task like preventing itself from overruning a previous task that is taking a long time.
  • Executor: The executor, as it's name suggests, is simply responsible for calling the task (go function) that the job hands to it when sent by the scheduler.

Examples

s := gocron.NewScheduler(time.UTC)

s.Every(5).Seconds().Do(func(){ ... })

// strings parse to duration
s.Every("5m").Do(func(){ ... })

s.Every(5).Days().Do(func(){ ... })

For more examples, take a look in our go docs

Options

Interval Supported schedule options
sub-second StartAt()
milliseconds StartAt()
seconds StartAt()
minutes StartAt()
hours StartAt()
days StartAt(), At()
weeks StartAt(), At(), Weekday() (and all week day named functions)
months StartAt(), At()

There are several options available to restrict how jobs run:

Mode Function Behavior
Default jobs are rescheduled at every interval
Job singleton SingletonMode() a long running job will not be rescheduled until the current run is completed
Scheduler limit SetMaxConcurrentJobs() set a collective maximum number of concurrent jobs running across the scheduler

FAQ

  • Q: I'm running multiple pods on a distributed environment. How can I make a job not run once per pod causing duplication?

  • A: We recommend using your own lock solution within the jobs themselves (you could use Redis, for example)

  • Q: I've removed my job from the scheduler, but how can I stop a long-running job that has already been triggered?

  • A: We recommend using a means of canceling your job, e.g. a context.WithCancel().


Looking to contribute? Try to follow these guidelines:

  • Use issues for everything
  • For a small change, just send a PR!
  • For bigger changes, please open an issue for discussion before sending a PR.
  • PRs should have: tests, documentation and examples (if it makes sense)
  • You can also contribute by:
    • Reporting issues
    • Suggesting new features or enhancements
    • Improving/fixing documentation

Design

design-diagram

Jetbrains supports this project with GoLand licenses. We appreciate their support for free and open source software!

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].