Core Library0.xAPI reference

Choose documentation 1

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

MoreLess about this notice

module libtmux-erlang

tmux_stream

Subscribe to pane bytes and notifications on a dedicated tmux control client.

Source and package
Qualified name
tmux_stream
Package
libtmux_erlang
Source
apps/libtmux_erlang/src/tmux_stream.erl

Description

Each subscription belongs to its creating process. Share a subscription so another process can join the client with its own credit. If the first subscriber's process exits, the client retires.

Messages have the form {tmux_stream, Subscription, Message}. An event contains its generation, sequence and native data. A gap reports unknown loss after the last delivered sequence and retires that subscription. Use a new subscription to observe subsequent output and tmux_pane:capture/2 to read the rendered screen.

Members10 members

Common operations4

  • subscribe/3 function Start a dedicated client on an owned or borrowed server and subscribe this process. Pass a session captured on that endpoint. Attaching skips the session environment update and ignores the client's size. Native hooks still run. The client retires when tmux reports a different session. The returned subscription includes its initial credit. Start effects after this call returns to observe their output. A startup error can return a control handle for tmux_control:close/1 when native retirement needs another attempt.
  • ack/3 function Acknowledge one delivered sequence in its generation. Duplicate acknowledgements are idempotent. Returned capacity can be requested again with demand/2.
  • demand/2 function Add credit for future deliveries. Unused credit plus delivered data awaiting acknowledgement must fit within 64 KiB and eight messages. An await_timeout leaves the credit change unconfirmed.
  • join/2 function Subscribe this process to the same dedicated client as an active subscription. The new subscription has its own credit and sequence numbers. It starts receiving data when it joins.

Other members6

  • close/1 function Close this subscription. Closing the final subscription waits for confirmed retirement of its control client. A cleanup error leaves retirement running and permits another close attempt.
  • credit/0 type Bytes cover the event's binary fields. Messages count events.
  • event/0 type Raw pane bytes or a native notification name and its unparsed fields.
  • message/0 type Messages delivered to the subscriber's mailbox.
  • options/0 type Initial credit defaults to 64 KiB and eight messages.
  • subscription/0 type One subscription on a dedicated control client.

Guides

task material

Pages that discuss tmux_stream.

Esc
Search in

Type to search.

Reference previewOpen reference