Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DebounceableRefresher ¶
type DebounceableRefresher struct { sync.Mutex // Refreshable is any type that can be refreshed. The refresh method should by protected by a mutex internally. Refreshable Refreshable // contains filtered or unexported fields }
DebounceableRefresher is used to debounce multiple attempts to refresh a refreshable type.
func (*DebounceableRefresher) RefreshAfter ¶
func (d *DebounceableRefresher) RefreshAfter(duration time.Duration)
RefreshAfter requests a refresh after a certain time has passed. Subsequent calls to this method will delay the requested refresh by the new duration. Note that this is a total override of the previous calls - calling RefreshAfter(time.Second * 2) and then immediately calling RefreshAfter(time.Microsecond * 1) will run a refresh in one microsecond
type Refreshable ¶
type Refreshable interface {
Refresh() error
}
Refreshable represents an object which can be refreshed. This should be protected by a mutex for concurrent operation.
Click to show internal directories.
Click to hide internal directories.