Documentation
¶
Overview ¶
Package wait polls until something the API reports is done, with a clock the caller passes in so tests never wait for real.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrTimeout = errors.New("timed out")
ErrTimeout is returned when the deadline passes before check reports done.
Functions ¶
func Until ¶
func Until(ctx context.Context, clock Clock, timeout time.Duration, interval time.Duration, check func(ctx context.Context) (bool, error)) error
Until calls check, then sleeps interval and calls it again, until check reports done, check fails, ctx is cancelled, or timeout has passed since the first call.