Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner runs a task periodically.
func Start ¶
Start creates and starts a new Runner to run the given task peridiocally. The timeout is used for the context timeout of the task. The timeout can be larger than the periodicity of the task. That means if a tasks takes a long time it will be immediately retriggered.
func (*Runner) Kill ¶
func (r *Runner) Kill()
Kill is like stop but it also cancels the context of the current running method.
func (*Runner) Stop ¶
func (r *Runner) Stop()
Stop stops the periodic execution of the Runner. If the task is currently running this method will block until it is done.
func (*Runner) TriggerRun ¶
func (r *Runner) TriggerRun()
TriggerRun triggers the periodic task to run now. This does not impact the normal periodicity of this task. That means if the periodicity is 5m and you call TriggerNow() after 2 minutes, the next execution will be in 3 minutes.
The method blocks until either the triggered run was started or the runner was stopped, in which case the triggered run will not be executed.
Directories
¶
Path | Synopsis |
---|---|
internal
|
|
metrics/mock_metrics
Package mock_metrics is a generated GoMock package.
|
Package mock_metrics is a generated GoMock package. |