Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DebouncedChan ¶
type DebouncedChan struct {
// contains filtered or unexported fields
}
DebouncedChan is a function that will only be called once per cooldown period, at the leading edge. If it is called again during the cooldown, the subsequent calls are delayed until the cooldown period has elapsed and are also coalesced into a single call.
func NewDebouncedChan ¶
func NewDebouncedChan(ctx context.Context, cooldown time.Duration) *DebouncedChan
NewDebouncedChan returns a new DebouncedChan which sends on the channel no more often than the cooldown period.
func (*DebouncedChan) C ¶
func (d *DebouncedChan) C() <-chan struct{}
func (*DebouncedChan) Call ¶
func (d *DebouncedChan) Call()
Click to show internal directories.
Click to hide internal directories.