# Libtmux_unix.Subscription

- **Package:** libtmux-unix
- **Language:** OCaml
- **Kind:** module
- **Source:** https://github.com/libtmux/libtmux-ocaml/blob/205dfda49742592b479247049d186956e4a4cfe9/unix/libtmux_unix.mli#L150
- **Public owner:** Libtmux_unix
- **Page:** https://libtmux.org/en/ocaml/latest/reference/libtmux_unix-subscription/

```ocaml
module Subscription
```

Bounded future-byte observation with Data/Gap/End and local cursors. Polling is local; waiting and admission belong to the backend.

## Members

### Other members

- [`close`](/en/ocaml/latest/reference/libtmux_unix-subscription-close/) (function): End an active subscription with Cancelled and discard pending data. Preserve an already ended subscription's terminal reason. Release and reap an unused lane; later calls retain cleanup failures. Does not stop the daemon. {!poll} can still read the terminal event.
- [`next`](/en/ocaml/latest/reference/libtmux_unix-subscription-next/) (function): Pump all subscription lanes until one event is available. Default deadline is one second. `None` follows a consumed End. A deadline keeps the subscription active; cancellation closes it and raises Cancelled.
- [`poll`](/en/ocaml/latest/reference/libtmux_unix-subscription-poll/) (function): Remove a queued event without I/O. Owning domain only, including after client closure. `None` means no queued event, not proof of continuity.
- [`t`](/en/ocaml/latest/reference/libtmux_unix-subscription-t/) (typealias)
- [`wait_for_bytes`](/en/ocaml/latest/reference/libtmux_unix-subscription-wait_for_bytes/) (function): Consume future bytes until the nonempty pattern matches, including across Data boundaries. Maximum pattern: 64 KiB. Return the cursor at the match's end within its consumed event. Gaps stop matching; no rendered or earlier output is searched. Timeout leaves the subscription active.
