# io.github.libtmux.control.EventSubscription.stream

- **Module:** io.github.libtmux.control
- **Package:** io.github.libtmux:libtmux
- **Language:** Java
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-java/blob/f56392b5d9bc7f1f9c1631842333fb90f3d82d40/libtmux/src/main/java/io/github/libtmux/control/EventSubscription.java#L366
- **Page:** https://libtmux.org/en/java/latest/reference/io-github-libtmux-control-eventsubscription-eventsubscription-stream/

```
io.github.libtmux.control.EventSubscription.stream() -> java.util.stream.Stream<Delivery<T>>
```

The steps still to come, in order, each read by the thread consuming the stream.

Pull-only: a step is read when the stream asks for one, and events that arrive meanwhile
wait in this subscription's buffer, so its capacity alone decides what becomes a {@link
Delivery.Gap}. The stream ends when this subscription closes. When the control client ended
it, the stream fails with {@link #cause()}. Closing the stream closes this subscription, and
closing this subscription from another thread ends a stream that is waiting.

## Examples

```java
try (Stream<Delivery<PaneOutput>> steps = subscription.stream()) {
steps.map(Delivery::kept).forEach(output -> System.out.print(output.data()));
}
```

## Raises

- [`io.github.libtmux.exception.LibTmuxException`](/en/java/latest/reference/io-github-libtmux-exception-libtmuxexception-libtmuxexception/): from the stream if the reading thread is interrupted; its interrupt status is set again
