WaitFor
WaitFor checks condition serially and immediately, then after each interval, until it succeeds, returns an error, or ctx ends. It validates interval, condition, and ctx in that order: interval must be positive, condition must be non-nil, and an already-ended context prevents every check. Condition errors and context errors are returned unchanged. A running condition receives ctx and must observe it itself; WaitFor cannot interrupt the condition.
Source and package
- Qualified name
-
tmuxtest.Wait For - Package
- tmuxtest
- Distribution
- github.com/libtmux/libtmux-go/tmux
- Source
- tmux/tmuxtest/wait.go
- func WaitFor( ctx context
.Context , interval time.Duration , condition func(context.Context ) (bool, error), ) error -
- Parameters
-
-
condition(func(context.Context ) (bool, error)) #
Guides#
Pages that discuss WaitFor.