Documentation
¶
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 holds a background goroutine that can do periodic work.
The work here cannot communicate errors directly, so it must communicate with channels or swallow errors.
NOTE: It's expected that Start and Stop are called on the same goroutine or be externally synchronized as to not race.
func NewWithContext ¶
NewWithContext creates new background work that runs every `duration` and performs `work`.
Work is passed a context that is cancelled when the overall periodic is cancelled.
Click to show internal directories.
Click to hide internal directories.