Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WaitSync ¶
func WaitSync(config *WaitSyncConfig) (terminalValue interface{}, err error)
WaitSync waits and returns when a given stop condition is true or if an error occurs.
Types ¶
type IntervalStrategy ¶
func FibonacciIntervalStrategy ¶
func FibonacciIntervalStrategy(base time.Duration, factor float32) IntervalStrategy
FibonacciIntervalStrategy defines an interval duration who follow the Fibonacci sequence.
func LinearIntervalStrategy ¶
func LinearIntervalStrategy(interval time.Duration) IntervalStrategy
LinearIntervalStrategy defines a linear interval duration.
type WaitSyncConfig ¶
type WaitSyncConfig struct { // This method will be called from another goroutine. Get func() (value interface{}, err error, isTerminal bool) IntervalStrategy IntervalStrategy Timeout time.Duration }
WaitSyncConfig defines the waiting options.
Click to show internal directories.
Click to hide internal directories.