Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IntervalRunner ¶
type IntervalRunner struct {
// contains filtered or unexported fields
}
IntervalRunner is an example implementation of AtomicRunState.
func NewIntervalRunner ¶
func NewIntervalRunner(action func(), interval time.Duration) *IntervalRunner
NewIntervalRunner Creates a new instance of an interval runner to execute the provided function on a designated interval until explicitly stopped.
func (*IntervalRunner) Start ¶
func (ir *IntervalRunner) Start() bool
Start begins the interval execution. It returns true if the interval execution successfully starts. It will return false if the interval execcution is already running.
func (*IntervalRunner) Stop ¶
func (ir *IntervalRunner) Stop() bool
Stop will explicitly stop the execution of the interval runner. If an action is already executing, it will wait until completion before processing the stop. Any attempts to start during the stopping phase will block until it's possible to Start() again