# io.github.libtmux.scaladsl.streaming.Observation.read

- **Module:** io.github.libtmux.scaladsl.streaming
- **Package:** io.github.libtmux:libtmux-scala_3
- **Language:** Scala
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-java/blob/f56392b5d9bc7f1f9c1631842333fb90f3d82d40/libtmux-scala/src/main/scala/io/github/libtmux/scaladsl/streaming/Observation.scala#L31
- **Page:** https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-streaming-observation-read/

```
def read[A](pollTimeout: Duration)(use: Iterator[Delivery[T]] => A): A
```

Runs `use` over every step waiting or arriving within `pollTimeout` per poll, until the subscription closes. Rejects a second, overlapping `read` on this observation.

## Parameters

- `pollTimeout` (`Duration`)
- `use` (`Iterator[Delivery[T]] => A`)

## Raises

- [`java.lang.IllegalStateException`](https://docs.oracle.com/en/java/javase/21/docs/api/java/lang/IllegalStateException.html): if another `read` on this observation is already in progress
