Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

keepchen/schedule

Repository files navigation

Schedule

Go CodeQL Go Report Card
A distributed scheduled task tool written in Go. It was incubated and evolved from the go-sail framework.

Requirement

go version >= 1.19

Installation

go get -u github.com/keepchen/schedule

Features

  • Interval task
  • Once time task
  • Linux Crontab Style task
  • Cancelable
  • Race detection
  • Manual call

Examples

Interval

schedule.NewJob("say hello").EveryMinute()

Once time

schedule.NewJob("check in").RunOnceTimeAfter(time.Second)

Linux Crontab Style

schedule.NewJob("good morning").RunAt(schedule.EveryDayOfEightAMClock)

Cancelable

cancel := schedule.NewJob("say hello").EveryMinute()
time.AfterFunc(time.Minute*3, cancel)

Race detection

Note: You must set redis provider before use.

// set redis provider
schedule.SetRedisProviderStandalone(...)
// or
schedule.SetRedisProviderClient(...)
schedule.NewJob("say hello").WithoutOverlapping().EveryMinute()

Manual call

schedule.Call("say hello", false)
schedule.MustCall("task not exist will be panic", true)

About

A distributed scheduled task tool written in Go.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /