Documentation ¶
Overview ¶
Package interval is a work in progress. Later versions may support parallel execution.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Runnable ¶
type Runnable interface { // called once at Start() time Setup() error // called on the interval defined by the // duration passed into NewRunner Run() error }
Runnable must be implemented by types passed into the Runner constructor.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner takes a list of `Runnable`s, calls Setup() on each of them and then calls Run() on each of them, using a Ticker, sequentially and within the same goroutine. Call Stop() to turn off the Ticker.
func NewRunner ¶
NewRunner creates a new interval runner. Pass in a duration (time between calls) and one or more Runnables to be run on the defined interval.
Click to show internal directories.
Click to hide internal directories.