Class SystemInfoPublisher¶
Defined in File system_info.hpp
Class Documentation¶
-
class SystemInfoPublisher¶
A publisher that periodically logs process and system statistics on a channel.
The publisher creates a channel on the configured Context (defaulting to
/sysinfo) and spawns a background task that logs aSystemInfomessage at the configured interval.The publisher runs until it is explicitly stopped via
stop(). Destroying this object does not stop the publisher: the background task continues running until the process exits, matching the Rust and Python SDK behavior of detaching the underlying task when the handle is dropped. Callstop()explicitly to abort the background task before the process exits.Note
SystemInfoPublisher is movable but not copyable, and is thread-safe.
Public Functions
-
FoxgloveError stop() noexcept¶
Stop the publisher and free its resources.
Aborts the background task. After calling stop(), the publisher is in an empty state and further calls to stop() are no-ops.
This is not called automatically by the destructor; if you want the publisher to stop when this object goes out of scope, call stop() explicitly.
Public Static Functions
-
static FoxgloveResult<SystemInfoPublisher> create(SystemInfoOptions &&options = {})¶
Create and start a system info publisher with the given options.
-
FoxgloveError stop() noexcept¶