Protective Stop
Loading...
Searching...
No Matches
protective_stop_machine::MachineAnnouncer Class Reference

Periodically POSTs a bearer-authenticated RUNNING check-in to a fleet console. More...

#include <announce.hpp>

Public Member Functions

 MachineAnnouncer (AnnounceConfig config, int port, uint32_t machine_id, std::function< MachineSnapshot()> snapshot_fn)
 MachineAnnouncer (const MachineAnnouncer &)=delete
MachineAnnouncer & operator= (const MachineAnnouncer &)=delete
bool start ()
 Launches the check-in thread.
void stop ()
 Stops the thread and joins. Idempotent.
bool enabled () const
 True while the check-in thread is running.

Detailed Description

Periodically POSTs a bearer-authenticated RUNNING check-in to a fleet console.

Runs on its own thread, off the safety path: failures only log. Driven from the node's activate/deactivate transitions, so it runs only while the node is ACTIVE. start() and stop() are idempotent.

Constructor & Destructor Documentation

◆ MachineAnnouncer()

protective_stop_machine::MachineAnnouncer::MachineAnnouncer ( AnnounceConfig config,
int port,
uint32_t machine_id,
std::function< MachineSnapshot()> snapshot_fn )
Parameters
configDeployment values.
portUDP port the machine listens on.
machine_idDevice ID of this machine.
snapshot_fnReturns the state to report; called from the check-in thread.

Member Function Documentation

◆ start()

bool protective_stop_machine::MachineAnnouncer::start ( )

Launches the check-in thread.

Returns
False when disabled (empty url) or the key file is unreadable. Non-fatal: announce is off the safety path and never fails activation.

The documentation for this class was generated from the following file: