Skip to content
Job scheduling made easy.
Branch: master
Clone or download
carlescere Merge pull request #7 from freshteapot/master
Improve the readme example.
Latest commit ee74d2f Jan 10, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore EverySeconds and EveryDay coded Feb 4, 2015
.travis.yml Add go1.6 to travis checks Mar 15, 2016
LICENSE Initial commit Feb 3, 2015 Improve the readme example. Jan 6, 2017
scheduler.go Remove data race in IsRunning method Oct 23, 2015
scheduler_test.go Remove data race in IsRunning method Oct 23, 2015


GoDoc Build Status Coverage Status

Job scheduling made easy.

Scheduler allows you to schedule recurrent jobs with an easy-to-read syntax.

Inspired by the article Rethinking Cron and the schedule python module.

How to use?

package main

import (


func main() {
	job := func() {
		t := time.Now()
		fmt.Println("Time's up! @", t.UTC())
      // Run every 2 seconds but not now.
      // Run now and every X.
      // Keep the program from not exiting.

How it works?

By specifying the chain of calls, a Job struct is instantiated and a goroutine is starts observing the Job.

The goroutine will be on pause until:

  • The next run scheduled is due. This will cause to execute the job.
  • The SkipWait channel is activated. This will cause to execute the job.
  • The Quit channel is activated. This will cause to finish the job.

Not immediate recurrent jobs

By default the behaviour of the recurrent jobs (Every(N) seconds, minutes, hours) is to start executing the job right away and then wait the required amount of time. By calling specifically .NotImmediately() you can override that behaviour and not execute it directly when the function Run() is called.



Distributed under MIT license. See LICENSE for more information.

You can’t perform that action at this time.