Core LibraryalphaAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

method libtmux-cxx latest

Connection.wait_for_notifications

The same, but waits for something to arrive.

Source and package
Qualified name
libtmux::Connection::wait_for_notifications
Namespace
libtmux
Declared in
Connection
Package
libtmux-cxx
Source
include/libtmux/control.hpp
[[C++ nodiscard attributeAsks the compiler to warn when a result is discarded. An explicit cast to void acknowledges that the result is intentionally ignored.Language documentation]] std::vector<Notification> wait_for_notifications( std::chrono::steady_clock::time_point deadline);

Description#

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.

Esc

Type to search.

Reference previewOpen reference