Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RunStop ¶
type RunStop interface { Run() Running() bool Stop() }
RunStop exposes a functions for running, stopping, and querying status of presumably a background job.
type Ticker ¶
type Ticker interface { // Start this ticker sending time on it's channel. Start() Ticker // Reset this ticker by creating a new channel and sending time on it. Reset() // Stop this ticker and release underlying resources. Stop() // SetPeriod of this ticker to the passed duration. The ticker must be restarted // after this change. SetPeriod(period time.Duration) // Channel that is used to send the 'ticks' Channel() <-chan time.Time }
Ticker sends the time, after a period, on it's channel once started.
func NewTicker ¶
NewTicker returns a new Ticker containing a channel that will send the time with a period specified by the duration argument once Started. It adjusts the intervals or drops ticks to make up for slow receivers. The duration d must be greater than zero; if not, NewTicker will panic. Stop the ticker to release associated resources.
Click to show internal directories.
Click to hide internal directories.