Core LibraryalphaAPI Reference

Choose documentation 1

latest

Current version

latest
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

struct libtmux-elixir latest

Operation

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

Source and package
Qualified name
LibTmux.Operation
Module
LibTmux
Package
libtmux
Source
lib/libtmux/operation.ex
struct LibTmux.Operation

Description#

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.

Discussed in Read values, execute explicitly · Execution ownership

Members18#

Common operations2#

  • await/2 function Waits for a canonical result under one positive millisecond timeout.
  • stop/1 function Requests closure of the pinned epoch through reserved capacity.

Other members16#

  • await!/2 function Waits or raises API errors; canonical failed, skipped and unknown outcomes remain values.
  • command_result/0: command_result() :: %{ outcome: :completed | :failed, certainty: :acknowledged, evidence: :command_reply, guard: LibTmux.Protocol.guard_id(), lines: [binary()] } typealias A qualified command reply, independently of wire retirement or program completion.
  • forget!/2 function Forgets the retained record or raises the same structured error.
  • forget/2 function Requests exact-record reclamation with a default 5000ms timeout.
  • option/0: option() :: {:timeout, pos_integer()} typealias A positive millisecond budget for one waiter or record-reclamation call.
  • result!/1 function Reads a result or :pending; raises API errors, preserving all canonical outcomes.
  • result/0: result() :: command_result() | skipped_result() | unknown_result() typealias The immutable canonical outcome; failed, skipped and unknown outcomes remain values.
  • result/1 function Returns a canonical result, :pending, or a retained-context error.
  • skipped_result/0: skipped_result() :: %{ outcome: :skipped, certainty: :no_write, evidence: :cancelled | :timeout | :epoch_closed } typealias A canonical no-write outcome, with the reason it was skipped before dispatch.
  • status!/1 function Reads retained status or raises the same structured error.
  • status/0: status() :: %{wire: wire(), result: result() | nil} typealias Retained wire progress and the canonical result, or nil while no outcome is established.
  • status/1 function Reads retained wire state and canonical result without contacting tmux.
  • stop!/1 function Requests epoch closure or raises the same structured error.
  • t/0 typealias A retained owner-bound operation handle; it is not a command result or a reservation.
  • unknown_result/0: unknown_result() :: %{ outcome: :unknown, certainty: :unknown, evidence: :epoch_closed } typealias An epoch closed without enough evidence to classify the operation's effects.
  • wire/0: wire() :: :unpublished | :unsent | :writing | :awaiting | :closing | :retired typealias Wire progress for this operation; retired wire does not prove connection cleanup.
Esc

Type to search.

Reference preview Open reference