# libtmux::Connection::wait_for_notifications

- **Module:** libtmux::Connection
- **Package:** libtmux-cxx
- **Language:** C++
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-cxx/blob/85e8bd603a322dc32bb8b9aeb1a72bcf36945f1d/include/libtmux/control.hpp#L249
- **Page:** https://libtmux.org/reference/cxx/libtmux-connection-wait_for_notifications/

```
libtmux::Connection::wait_for_notifications(deadline: std::chrono::steady_clock::time_point) -> std::vector< Notification >
```

The same, but waits for something to arrive.

`take_notifications` returns immediately, so a caller reacting to tmux had to call it in a loop and sleep between — which either wakes too often or reacts too late, and picks that trade with no idea how long the next event will take. This blocks until at least one event is available, the connection fails, or the deadline passes, and returns whatever it has.

An empty result means the deadline passed or the stream ended; the two are told apart by asking `execute` or `shutdown`, which report the failure. Events already buffered are returned without waiting at all.
