Poll
Poll checks condition immediately and then after each interval, until it reports true, returns an error, or ctx ends.
Source and package
- Qualified name
-
tmux.Poll - Package
- tmux
- Distribution
- github.com/libtmux/libtmux-go/tmux
- Source
- tmux/poll.go
- func Poll( ctx context
.Context , interval time.Duration , condition func(context.Context ) (bool, error), ) error -
Description#
A condition receives ctx and must observe cancellation itself; Poll cannot interrupt one already running. Poll returns condition errors unchanged and ctx.Err when ctx ends first.
Poll is for a state tmux does not announce. Waiting for a pane to print something is not one:
Pane.WaitForTextpolls the visible screen with the liveness and end-of-pane handling a bare condition lacks, andPaneObservation.WaitForis woken by tmux as the pane writes.Server.WaitForwaits on tmux's separate wait-for channel.- Parameters
-
-
condition(func(context.Context ) (bool, error)) #