tmux_command:wait_for/2
Build a native wait-for command without I/O. Channels are nonempty NUL-free binary names, subject to the command reservation in raw/2; neither shell nor format expansion occurs. Submit through tmux_operation:start/3 for a wait that leaves the caller free, or through tmux_server:command/3 to await it.
Source and package
- Qualified name
-
tmux_command: wait _for/2 - Declared in
tmux_command- Package
- libtmux_erlang
- Source
- apps/libtmux_erlang/src/tmux_command.erl
- Other languages
- Perl PowerShell Julia Elixir Haskell Common Lisp PythonRuby Lua TypeScript RustGo Java C#C++Swift Kotlin Scala OCaml F# Clojure
- wait_for(Channel, Action) -spec wait_for(binary(), wait
_action ()) -> {ok, t()} | {error, map()}. -
Description#
signalwakes current waiters. On an unlocked channel with no waiters or pending wakeup, it retains one wakeup for a later wait. Signaling that channel again before a wait can clear the pending state. Signals are neither counted nor reliably coalesced events; send once per expected wait. Channel names are shared by all clients of the server. Use separate names for signaling and locking.lockacquires an advisory channel lock or waits for an explicitunlock; a completed command client's exit does not release its acquired lock. Unlocking an unlocked channel is a native command error.Cancellation retires the library client. It does not undo a signal or release a lock that may already have been acquired; an uncertain lock outcome needs application coordination before another unlock. This is not an owned mutex.
Examples#
1> {ok, Signal} = tmux_command:wait_for(<<"build-ready">>, signal), ok.ok2> tmux_command:argv(Signal).[<<"wait-for">>,<<"-S">>,<<"--">>,<<"build-ready">>]
Guides#
Pages that discuss wait_for/2.
In other ports#
Wait for, signal or lock a channel
| Language | Equivalent |
|---|---|
| Python | libtmux |
| Ruby | Lib |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | no equivalent on Server |
| Rust | server |
| Go | tmux |
| Java | no equivalent on Server |
| C# | Lib |
| C++ | libtmux:: |
| Swift | Server |
| OCaml | Libtmux |
| Perl | No dedicated equivalent in the selected Perl surface. Explicit Server::cmd remains available for native tmux commands. |
No equivalent is recorded in Lua, PowerShell, Julia, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.