# io.github.libtmux.scaladsl.ox.Flows.subscription

- **Module:** io.github.libtmux.scaladsl.ox
- **Package:** io.github.libtmux:libtmux-scala_3
- **Language:** Scala
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-java/blob/f56392b5d9bc7f1f9c1631842333fb90f3d82d40/libtmux-scala-ox/src/main/scala/io/github/libtmux/scaladsl/ox/Flows.scala#L24
- **Page:** https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-ox-flows-subscription/

```
def subscription[T](sub: EventSubscription[T]): Flow[Delivery[T]]
```

One `Flow` element per step: an event this subscription kept, or a gap naming what was lost. Collecting the flow takes the subscription for good, through the Java subscription's own single-reader claim, and closes it when the collection ends. A second collection is refused as it starts, before it can disturb the first. The flow fails with the control client's cause if the client ended the subscription.

## Parameters

- `sub` (`EventSubscription[T]`)
