# io.github.libtmux.Channel.Channel

- **Module:** io.github.libtmux.Channel
- **Package:** io.github.libtmux:libtmux
- **Language:** Java
- **Kind:** class
- **Source:** https://github.com/libtmux/libtmux-java/blob/c3517519ee799428a809ce6deb1708c8be289cd1/libtmux/src/main/java/io/github/libtmux/Channel.java#L19
- **Page:** https://libtmux.org/reference/java/io-github-libtmux-channel-channel/

One of tmux's wait-for channels, named once.

<p>A channel is server-wide and shared by everything on it, including programs running in panes.
Nothing creates or destroys one: a name either has a signal remembered against it or does not.

<p>tmux's own {@code wait-for} has two traps, and this exists to close both. It exits successfully
when the server dies under the waiter, which is indistinguishable from a real signal, so the
server is checked afterwards rather than believed. And a signal sent when nobody is waiting is
remembered, satisfying the next wait whenever that happens — possibly in a later run of a
different program — so {@link #drain()} is how a caller starts from a known state on a channel
whose history is not its own.

## Members

- `Channel` (method)
- `name` (method) — The name this channel is known by on its server.
- `signal` (method) — Signals the channel, waking one waiter, or being remembered until something waits.
- `await` (method) — Waits for something to signal the channel.
- `awaitReservingCapacity` (method) — Waits while preserving process capacity for a call through this server that signals it.
- `drain` (method) — Consumes a signal already waiting, so a stale one cannot satisfy a later wait.
- `toString` (method)
