Versions in this module Expand all Collapse all v0 v0.22.3 Sep 17, 2021 Changes in this version + var ErrWaitTimeout = errors.New("timed out waiting for the condition") + var ForeverTestTimeout = time.Second * 30 + var NeverStop <-chan struct{} = make(chan struct{}) + func BackoffUntil(f func(), backoff BackoffManager, sliding bool, stopCh <-chan struct{}) + func ExponentialBackoff(backoff Backoff, condition ConditionFunc) error + func ExponentialBackoffWithContext(ctx context.Context, backoff Backoff, condition ConditionFunc) error + func Forever(f func(), period time.Duration) + func Jitter(duration time.Duration, maxFactor float64) time.Duration + func JitterUntil(f func(), period time.Duration, jitterFactor float64, sliding bool, ...) + func JitterUntilWithContext(ctx context.Context, f func(context.Context), period time.Duration, ...) + func NonSlidingUntil(f func(), period time.Duration, stopCh <-chan struct{}) + func NonSlidingUntilWithContext(ctx context.Context, f func(context.Context), period time.Duration) + func Poll(interval, timeout time.Duration, condition ConditionFunc) error + func PollImmediate(interval, timeout time.Duration, condition ConditionFunc) error + func PollImmediateInfinite(interval time.Duration, condition ConditionFunc) error + func PollImmediateInfiniteWithContext(ctx context.Context, interval time.Duration, ...) error + func PollImmediateUntil(interval time.Duration, condition ConditionFunc, stopCh <-chan struct{}) error + func PollImmediateUntilWithContext(ctx context.Context, interval time.Duration, ...) error + func PollImmediateWithContext(ctx context.Context, interval, timeout time.Duration, ...) error + func PollInfinite(interval time.Duration, condition ConditionFunc) error + func PollInfiniteWithContext(ctx context.Context, interval time.Duration, ...) error + func PollUntil(interval time.Duration, condition ConditionFunc, stopCh <-chan struct{}) error + func PollUntilWithContext(ctx context.Context, interval time.Duration, ...) error + func PollWithContext(ctx context.Context, interval, timeout time.Duration, ...) error + func Until(f func(), period time.Duration, stopCh <-chan struct{}) + func UntilWithContext(ctx context.Context, f func(context.Context), period time.Duration) + func WaitFor(wait WaitFunc, fn ConditionFunc, done <-chan struct{}) error + func WaitForWithContext(ctx context.Context, wait WaitWithContextFunc, fn ConditionWithContextFunc) error + type Backoff struct + Cap time.Duration + Duration time.Duration + Factor float64 + Jitter float64 + Steps int + func (b *Backoff) Step() time.Duration + type BackoffManager interface + Backoff func() clock.Timer + func NewExponentialBackoffManager(initBackoff, maxBackoff, resetDuration time.Duration, ...) BackoffManager + func NewJitteredBackoffManager(duration time.Duration, jitter float64, c clock.Clock) BackoffManager + type ConditionFunc func() (done bool, err error) + func (cf ConditionFunc) WithContext() ConditionWithContextFunc + type ConditionWithContextFunc func(context.Context) (done bool, err error) + type Group struct + func (g *Group) Start(f func()) + func (g *Group) StartWithChannel(stopCh <-chan struct{}, f func(stopCh <-chan struct{})) + func (g *Group) StartWithContext(ctx context.Context, f func(context.Context)) + func (g *Group) Wait() + type WaitFunc func(done <-chan struct{}) <-chan struct + func (w WaitFunc) WithContext() WaitWithContextFunc + type WaitWithContextFunc func(ctx context.Context) <-chan struct