Core LibraryunreleasedAPI Reference

Choose documentation 1

latest

Current version

latest
English

Unreleased libtmux_erlang has not been released. Its API may change during development. This site's structure and URLs may change too.

function libtmux-erlang latest

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#

signal wakes 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. lock acquires an advisory channel lock or waits for an explicit unlock; 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.
ok
2> tmux_command:argv(Signal).
[<<"wait-for">>,<<"-S">>,<<"--">>,<<"build-ready">>]
Parameters

Guides#

Pages that discuss wait_for/2.

In other ports#

Wait for, signal or lock a channel

Equivalents of Wait for, signal or lock a channel in other languages
Language Equivalent
Python libtmux.Server.wait_for
Ruby LibTmux::Server#wait_for
Haskell No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
TypeScript no equivalent on Server
Rust server.Server.wait_for_channel
Go tmux.Server.WaitFor
Java no equivalent on Server
C# LibTmux.Server.WaitForAsync
C++ libtmux::Server::wait_for
Swift Server.wait(for:)
OCaml Libtmux_unix.Client.wait_for
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#.

Esc

Type to search.

Reference previewOpen reference