Documentation ¶
Overview ¶
Package ticker implements tickers for the scheduler.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ticker ¶
type Ticker interface { // C returns the channel that ticks are sent on. C() <-chan time.Time // Stop stops the ticker. Stop() }
Ticker describes the interface for tickers in this package.
func NewPeriodic ¶
NewPeriodic creates a new ticker based on the provided clock and with the provided period.
This ticker ticks at a given period like the standard library's ticker, but has an additional feature. Before sending the first tick it waits a random duration of time (but no more than the period). This means that ticks are smoothed out across different tickers started at the same time.
Click to show internal directories.
Click to hide internal directories.