# Libtmux_eio.Subscription

- **Package:** libtmux-eio
- **Language:** OCaml
- **Kind:** module
- **Source:** https://github.com/libtmux/libtmux-ocaml/blob/205dfda49742592b479247049d186956e4a4cfe9/eio/libtmux_eio.mli#L95
- **Public owner:** Libtmux_eio
- **Page:** https://libtmux.org/en/ocaml/latest/reference/libtmux_eio-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

### Common operations

- [`wait_for_bytes`](/en/ocaml/latest/reference/libtmux_eio-subscription-wait_for_bytes/) (function): Consume future observed bytes through a match, with a maximum 64 KiB nonempty pattern. Match across Data boundaries and return its end cursor. Gaps end matching. This searches neither rendered text nor history. A deadline leaves the subscription active; cancellation closes it.

### Other members

- [`close`](/en/ocaml/latest/reference/libtmux_eio-subscription-close/) (function): End an active subscription with Cancelled and discard pending data. Preserve an already ended subscription's terminal reason. Concurrent calls join the same cleanup, including reaping a lane when it becomes unused; later calls retain cleanup failures. Borrowed clients and the daemon remain alive. {!poll} can still read the terminal event.
- [`next`](/en/ocaml/latest/reference/libtmux_eio-subscription-next/) (function): Await one event, defaulting to a one-second deadline. `None` follows a consumed End. A deadline keeps the subscription active. Eio cancellation closes it, releases its lane when unused, and propagates.
- [`poll`](/en/ocaml/latest/reference/libtmux_eio-subscription-poll/) (function): Remove a queued event without I/O, on the owning domain.
- [`t`](/en/ocaml/latest/reference/libtmux_eio-subscription-t/) (typealias)
