Protocol
Assembles bounded control-mode replies and lexical notifications from bytes.
Source and package
- Qualified name
-
LibTmux .Protocol - Module
- LibTmux
- Package
- libtmux
- Source
- lib/libtmux/protocol.ex
-
Description#
Reply guards retain timestamp, command number and flags. Inside a block, notification-looking output stays data. The parser cannot authenticate injected matching guards: shared lanes must separately qualify commands, hooks and subscription expansion. Notification payloads need semantic validation before they can update a graph.
A parse error retains already completed events in
error.details.events. Its owner must retire the lane rather than reuse the rejected state.Discussed in Command and field encoding
Members7#
- event/0: event() ::
{:reply, :ok | :error, guard
_id (), [binary()]} | {:notification, atom(), binary()} | {:unknown, binary()} typealias A framed reply or lexical notification. Payloads still require semantic validation before graph updates. - feed/2 function Consumes one byte chunk without performing I/O.
- finish/1 function Rejects a stream ending inside a line or reply block.
- guard_id/0: guard
_id () :: {non_neg (), non_integer _neg (), non_integer _neg ()} typealias A complete tmux reply guard: timestamp, command number and flags, retained for correlation._integer - new/1 function Constructs a parser with positive byte, line and event limits.
- option/0: option() ::
{:max_chunk_bytes
| :max_line_bytes
| :max_frame_bytes
| :max_frame_lines
| :max_events, pos
_integer ()} typealias A positive parser ceiling, measured in bytes, lines or emitted events as named. - t/0 typealias Immutable parser carry and bounded in-flight frame state; discard it after any parse error.