a cron library for go
Go
Pull request Compare This branch is 2 commits ahead, 45 commits behind robfig:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
.travis.yml
LICENSE
README.md
constantdelay.go
constantdelay_test.go
cron.go
cron_test.go
doc.go
parser.go
parser_test.go
semaphore.go
spec.go
spec_test.go

README.md

cron

crontab for golang

peference

TODO    

usage

import (
    "fmt"
    "time"

    ncron "github.com/niean/cron"
)

func main() {
    // init cron
    c := ncron.New()

    // add cron job
    c.AddFunc("* * * * * *", func() { fmt.Println("Every second") })
    c.AddFuncCC("* * * * * *", func() { fmt.Println("Every second, with max Concurrrent 2"); time.Sleep(10 * time.Second)}, 2)

    // start cron
    c.Start()

    // keep alive
    select {}
}

reference