Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SecondsAsDuration ¶
SecondsAsDuration is a simple shortcut for converting seconds represented as a float to a `time.Duration`.
Types ¶
type TickerWithInitialTick ¶
type TickerWithInitialTick struct { // C fires once on initial startup, then after each interval has passed. C <-chan time.Time // contains filtered or unexported fields }
TickerWithInitialTick is similar to `time.Ticker`, except that it fires once immediately upon initialization. It also respects context cancellation and prefers to be stopped that way rather than an explicit `Stop` function.
func NewTickerWithInitialTick ¶
func NewTickerWithInitialTick(ctx context.Context, interval time.Duration) *TickerWithInitialTick
NewTickerWithInitialTick creates a new ticker similar to `time.Ticker`, except that it fires once immediately upon initialization. It also respects context cancellation and prefers to be stopped that way rather than an explicit `Stop` function.
Click to show internal directories.
Click to hide internal directories.