Documentation ¶
Overview ¶
Package periodic allow to execute a specified function periodically.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Periodic ¶
type Periodic struct {
// contains filtered or unexported fields
}
Periodic instance.
func New ¶
func New(interval time.Duration, jitter time.Duration, timeout time.Duration, task TaskFn) (*Periodic, error)
New creates a new Periodic instance. The jitter parameter is the maximum random Jitter time between each function call. This is useful to avoid the Thundering herd problem (https://en.wikipedia.org/wiki/Thundering_herd_problem).
Click to show internal directories.
Click to hide internal directories.