Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ThrottleTimer ¶
type ThrottleTimer struct { Name string Ch chan struct{} // contains filtered or unexported fields }
ThrottleTimer fires an event at most "dur" after each .Set() call. If a short burst of .Set() calls happens, ThrottleTimer fires once. If a long continuous burst of .Set() calls happens, ThrottleTimer fires at most once every "dur".
func NewThrottleTimer ¶
func NewThrottleTimer(name string, dur time.Duration) *ThrottleTimer
func (*ThrottleTimer) Set ¶
func (t *ThrottleTimer) Set()
func (*ThrottleTimer) Stop ¶
func (t *ThrottleTimer) Stop() bool
For ease of .Stop()'ing services before .Start()'ing them, we ignore .Stop()'s on nil ThrottleTimers
func (*ThrottleTimer) Unset ¶
func (t *ThrottleTimer) Unset()
Click to show internal directories.
Click to hide internal directories.