Documentation
¶
Overview ¶
Package clockwerk implements an in-process scheduler for periodic jobs.
Usage ¶
Callers may register Jobs to be invoked on a given schedule. Clockwerk will run them in their own goroutines.
type DummyJob struct{}
func (d DummyJob) Run() {
fmt.Println("Every 30 seconds")
}
...
var job DummyJob
c := clockwerk.New()
c.Every(30 * time.Second).Do(job)
c.Start()
...
// Funcs are invoked in their own goroutine, asynchronously.
...
c.Stop() // Stop the scheduler (does not stop any jobs already running).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Clockwerk ¶
type Clockwerk struct {
// contains filtered or unexported fields
}
Clockwerk keeps track of any number of entries, invoking associated Job's Run method as specified by the schedule.
Click to show internal directories.
Click to hide internal directories.