# io.github.libtmux.snapshot.ServerMirror.onNewer

- **Module:** io.github.libtmux.snapshot
- **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/snapshot/ServerMirror.java#L160
- **Page:** https://libtmux.org/en/java/latest/reference/io-github-libtmux-snapshot-servermirror-servermirror-onnewer/

```
io.github.libtmux.snapshot.ServerMirror.onNewer(epoch: long, callback: Runnable) -> void
```

Arms a one-shot wakeup for when a view newer than {@code epoch} is published or the mirror ends.

Runs {@code callback} at once, on this thread, when such a view already exists or the mirror
has ended; otherwise once, on the mirror's own thread. The callback must not block.

## Raises

- [`IllegalStateException`](https://docs.oracle.com/en/java/javase/21/docs/api/java/lang/IllegalStateException.html): if a callback is already armed
