On this page
tmuxtest.WaitFor
- Module
- tmuxtest
- Package
- github.com/libtmux/libtmux-go/tmux
- Source
- tmux/tmuxtest/wait.go
- WaitFor ( ctx : context.Context , interval : time.Duration , condition : func(context.Context) (bool, error) ) error
-
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.
Discussed in Waiting and retrying
0 declared, 0 inherited