# LibTmux.Operation

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Elixir
- **Kind:** struct
- **Source:** https://github.com/libtmux/libtmux-elixir/blob/66b9b1c3f3f3186428abdfda2c76f5cf87446710/lib/libtmux/operation.ex#L1
- **Page:** https://libtmux.org/en/elixir/latest/reference/libtmux-operation/

A retained operation handle pinned to its original owner, tables and epoch.

`result/1` and `status/1` read local retained values. `await/2` owns a separate
bounded waiter; its timeout never stops the operation. `stop/1` requests
closure of the operation's entire connection epoch, including siblings.
It does not roll back effects or prove native cleanup.

Canonical results carry `outcome`, `certainty` and `evidence`. Completed,
failed, skipped and unknown outcomes remain values, including in bang APIs.
Bang functions raise only API or metadata errors. A command reply is distinct
from wire retirement and arbitrary program exit.

Normal reconnect preserves retained records until forget or expiry. Owner
replacement loses those tables; a handle never follows a replacement view.
Handles recovered from `LibTmux.Control.execute/3` errors also remain owned
by that original caller: its death permits reclamation after wire retirement.

## Members

### Common operations

- [`await/2`](/en/elixir/latest/reference/libtmux-operation-await-2/) (function): Waits for a canonical result under one positive millisecond timeout.
- [`stop/1`](/en/elixir/latest/reference/libtmux-operation-stop-1/) (function): Requests closure of the pinned epoch through reserved capacity.

### Other members

- [`await!/2`](/en/elixir/latest/reference/libtmux-operation-await-bang-2/) (function): Waits or raises API errors; canonical failed, skipped and unknown outcomes remain values.
- [`command_result/0`](/en/elixir/latest/reference/libtmux-operation-command_result-0/) (typealias): A qualified command reply, independently of wire retirement or program completion.
- [`forget!/2`](/en/elixir/latest/reference/libtmux-operation-forget-bang-2/) (function): Forgets the retained record or raises the same structured error.
- [`forget/2`](/en/elixir/latest/reference/libtmux-operation-forget-2/) (function): Requests exact-record reclamation with a default 5000ms timeout.
- [`option/0`](/en/elixir/latest/reference/libtmux-operation-option-0/) (typealias): A positive millisecond budget for one waiter or record-reclamation call.
- [`result!/1`](/en/elixir/latest/reference/libtmux-operation-result-bang-1/) (function): Reads a result or `:pending`; raises API errors, preserving all canonical outcomes.
- [`result/0`](/en/elixir/latest/reference/libtmux-operation-result-0/) (typealias): The immutable canonical outcome; failed, skipped and unknown outcomes remain values.
- [`result/1`](/en/elixir/latest/reference/libtmux-operation-result-1/) (function): Returns a canonical result, `:pending`, or a retained-context error.
- [`skipped_result/0`](/en/elixir/latest/reference/libtmux-operation-skipped_result-0/) (typealias): A canonical no-write outcome, with the reason it was skipped before dispatch.
- [`status!/1`](/en/elixir/latest/reference/libtmux-operation-status-bang-1/) (function): Reads retained status or raises the same structured error.
- [`status/0`](/en/elixir/latest/reference/libtmux-operation-status-0/) (typealias): Retained wire progress and the canonical result, or nil while no outcome is established.
- [`status/1`](/en/elixir/latest/reference/libtmux-operation-status-1/) (function): Reads retained wire state and canonical result without contacting tmux.
- [`stop!/1`](/en/elixir/latest/reference/libtmux-operation-stop-bang-1/) (function): Requests epoch closure or raises the same structured error.
- [`t/0`](/en/elixir/latest/reference/libtmux-operation-t-0/) (typealias): A retained owner-bound operation handle; it is not a command result or a reservation.
- [`unknown_result/0`](/en/elixir/latest/reference/libtmux-operation-unknown_result-0/) (typealias): An epoch closed without enough evidence to classify the operation's effects.
- [`wire/0`](/en/elixir/latest/reference/libtmux-operation-wire-0/) (typealias): Wire progress for this operation; retired wire does not prove connection cleanup.
