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.notification_fd

A descriptor that is readable exactly when a take would return something.

Source and package
Qualified name
libtmux::Connection::notification_fd
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]] int notification_fd() const noexcept;

Description#

For a caller who owns their own event loop. Without it, integrating means a thread blocked in wait_for_notifications(), a queue of their own, and a self-pipe to wake the loop — which is this descriptor, rebuilt by hand on top of the thread and queue this connection already has.

Do not read from it: readability is the signal and the byte is this connection's to consume. Drain with take_notifications(), which clears it. A broken stream makes it readable too, so a poller learns of the failure rather than waiting for an answer that cannot come.

Valid until the connection is destroyed or moved from; -1 if the pipe could not be created.

Esc

Type to search.

Reference previewOpen reference