Popularity
6.7
-
Activity
4.5
Growing
537
13
25

Programming language: Go
License: MIT License
Tags: Job Scheduler    
Latest version: v0.3.3

go-quartz alternatives and similar packages

Based on the "Job Scheduler" category.
Alternatively, view go-quartz alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of go-quartz or a related project?

Add another 'Job Scheduler' Package

README

go-quartz

Build Status GoDoc Go Report Card codecov

A minimalistic and zero-dependency scheduling library for Go.

About

Inspired by the Quartz Java scheduler.

Library building blocks

Job interface. Any type that implements it can be scheduled.

type Job interface {
    Execute()
    Description() string
    Key() int
}

Implemented Jobs

  • ShellJob
  • CurlJob

Scheduler interface

type Scheduler interface {
    // start the scheduler
    Start()
    // whether the scheduler has been started
    IsStarted() bool
    // schedule the job with the specified trigger
    ScheduleJob(job Job, trigger Trigger) error
    // get all scheduled jobs keys
    GetJobKeys() []int
    // get the scheduled job metadata
    GetScheduledJob(key int) (*ScheduledJob, error)
    // remove the job from the execution queue
    DeleteJob(key int) error
    // clear all scheduled jobs
    Clear()
    // shutdown the scheduler
    Stop()
}

Implemented Schedulers

  • StdScheduler

Trigger interface

type Trigger interface {
    NextFireTime(prev int64) (int64, error)
    Description() string
}

Implemented Triggers

  • CronTrigger
  • SimpleTrigger
  • RunOnceTrigger

Examples

sched := quartz.NewStdScheduler()
sched.Start()
cronTrigger, _ := quartz.NewCronTrigger("1/5 * * * * *")
shellJob := quartz.NewShellJob("ls -la")
curlJob, _ := quartz.NewCurlJob(http.MethodGet, "http://worldclockapi.com/api/json/est/now", "", nil)
sched.ScheduleJob(shellJob, cronTrigger)
sched.ScheduleJob(curlJob, quartz.NewSimpleTrigger(time.Second*7))
sched.Stop()

More code samples can be found in the examples directory.

License

Licensed under the MIT License.


*Note that all licence references and agreements mentioned in the go-quartz README section above are relevant to that project's source code only.