wait

package
v0.7.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

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

type ConditionFunc func() (done bool, err error)

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.

type WaitFunc

type WaitFunc func(done <-chan struct{}) <-chan struct{}

WaitFunc creates a channel that receives an item every time a test should be executed and is closed when the last test should be invoked.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL