Scheduler package is a zero-dependency scheduling library for Go
go get -u github.com/GoFarsi/scheduler
- Scheduling your functions
- In a scheduler instance, you can run more than one thousand jobs at a time (Max Job is
10.000
) - In the form of Safely, you can run your jobs and if a panic occurs, your jobs will be recovered and reported to the console (
func (j *Job) DoJobSafely(jobFunction interface{}, params ...interface{}) error
) - Multiple scheduler instances can be run simultaneously
package main
import (
"fmt"
"github.com/GoFarsi/scheduler"
)
var (
Sched = Scheduler.NewScheduler()
)
func main() {
if err := Sched.Every(5).Second().Do(Greeting); err != nil {
panic(err)
}
<-Sched.Start()
}
func Greeting() {
fmt.Println("Hello, World!")
}
We'd love to see your contribution to the scheduler! you can contribute by following these steps :
- Fork the repository
- Create a new branch
- Make your changes
- Commit your changes
- Push your changes to the remote repository
- Create a pull request