# io.github.libtmux.control.EventSubscription.EventSubscription.next

- **Module:** io.github.libtmux.control.EventSubscription.EventSubscription
- **Package:** io.github.libtmux:libtmux
- **Language:** Java
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-java/blob/c3517519ee799428a809ce6deb1708c8be289cd1/libtmux/src/main/java/io/github/libtmux/control/EventSubscription.java#L80
- **Page:** https://libtmux.org/reference/java/io-github-libtmux-control-eventsubscription-eventsubscription-next/

```
io.github.libtmux.control.EventSubscription.EventSubscription.next() -> Optional<T>
```

Waits until the next event arrives or this subscription closes.

## Returns

the oldest buffered event, or empty when the subscription closed

## Raises

- `InterruptedException` — if the waiting thread is interrupted
