Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlignedTicker ¶
func NewFixedTimer ¶
func NewFixedTimer(start time.Time, interval time.Duration) *AlignedTicker
func (*AlignedTicker) Stop ¶
func (at *AlignedTicker) Stop()
Stop the AlignedTicker from generating any more ticks on its channel. Like time.Ticker.Stop() and time.Timer.Stop(), does not close the public channel, so that a read on the channel won't unblock.
type JitterTicker ¶
type JitterTicker struct { C <-chan time.Time // The channel on which the ticks are delivered. // contains filtered or unexported fields }
func NewJitterTicker ¶
func NewJitterTicker(d time.Duration, windowStart uint, windowEnd uint) *JitterTicker
Creates a jittered ticker windowStart and windowEnd specify the jitter range relative to the d interval For example, with d=1000ms start=80 and end=120, the first tick will happen after a random delay between 800ms and 1200ms. Subsequent ticks will happen every 1000ms.
func (*JitterTicker) Stop ¶
func (t *JitterTicker) Stop()
Stop turns off a ticker. After Stop, no more ticks will be sent. Stop does not close the channel, to prevent a read from the channel succeeding incorrectly.
Click to show internal directories.
Click to hide internal directories.