Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Periodic ¶
type Periodic interface { // Do begins the periodic job. It starts the first execution of the job, and then is // responsible for executing it every Frequency() thereafter Do() error Frequency() time.Duration Name() string FirstRun() bool }
Periodic is an interface for managing periodic job invocation
type PeriodicCanceller ¶
type PeriodicCanceller func()
PeriodicCanceller will cancel one or more Periodic jobs
func DoPeriodic ¶
func DoPeriodic(pSlice []Periodic) PeriodicCanceller
DoPeriodic calls p.Do() once, and then again every p.Frequency() on each element p in pSlice. For each p in pSlice, a new goroutine is started, and the returned channel can be closed to stop all of the goroutines.
Click to show internal directories.
Click to hide internal directories.