Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Poll ¶
func Poll(interval, timeout time.Duration, condition ConditionFunc) error
Poll tries a condition func until it returns true, an error, or the timeout is reached. condition will always be invoked at least once but some intervals may be missed if the condition takes too long or the time window is too short. If you want to Poll something forever, see PollInfinite. Poll always waits the interval before the first check of the condition.
func PollUntilNoError ¶
func PollUntilNoError(interval, timeout time.Duration, condition NoErrorConditionFunc) error
PollUntilNoError tries a condition func until it returns no error, or the timeout is reached.
Types ¶
type ConditionFunc ¶
ConditionFunc returns true if the condition is satisfied, or an error if the loop should be aborted.
type NoErrorConditionFunc ¶
type NoErrorConditionFunc func() error
NoErrorConditionFunc returns the error, or return nil if the loop should be aborted.
Click to show internal directories.
Click to hide internal directories.