Entropic 2.3.8
Local-first agentic inference engine
Loading...
Searching...
No Matches
entropic::HealthMonitor Class Reference

Monitors external server connections and handles reconnection. More...

#include <entropic/mcp/health_monitor.h>

Public Types

using StatusCallback = std::function< void(const HealthEvent &)>
 Callback invoked on engine thread when processing events.
 

Public Member Functions

 HealthMonitor (ReconnectPolicy policy, uint32_t health_check_interval_ms=0)
 Construct with reconnection policy.
 
 ~HealthMonitor ()
 Destructor — stops monitor if running.
 
void watch (const std::string &name, ExternalMCPClient *client)
 Start monitoring a server.
 
void unwatch (const std::string &name)
 Stop monitoring a server.
 
void set_status_callback (StatusCallback cb)
 Set callback for status change events.
 
void start ()
 Start the monitoring thread.
 
void stop ()
 Stop monitoring and all reconnection attempts.
 
void process_events ()
 Drain event queue, invoke callbacks (call on engine thread).
 

Detailed Description

Monitors external server connections and handles reconnection.

The monitor thread checks connection state periodically and attempts reconnection using ReconnectPolicy. Events are queued for the engine thread to process (no direct cross-thread mutation).

Version
1.8.7

Definition at line 55 of file health_monitor.h.

Member Typedef Documentation

◆ StatusCallback

using entropic::HealthMonitor::StatusCallback = std::function<void(const HealthEvent&)>

Callback invoked on engine thread when processing events.

Version
1.8.7

Definition at line 61 of file health_monitor.h.

Constructor & Destructor Documentation

◆ HealthMonitor()

entropic::HealthMonitor::HealthMonitor ( ReconnectPolicy  policy,
uint32_t  health_check_interval_ms = 0 
)

Construct with reconnection policy.

Parameters
policyBackoff policy for reconnection attempts.
health_check_interval_msPing interval (0 = disabled).
Version
1.8.7
Parameters
policyBackoff policy.
health_check_interval_msPing interval (0 = disabled).

Definition at line 22 of file health_monitor.cpp.

◆ ~HealthMonitor()

entropic::HealthMonitor::~HealthMonitor ( )

Destructor — stops monitor if running.

Definition at line 33 of file health_monitor.cpp.

Member Function Documentation

◆ process_events()

void entropic::HealthMonitor::process_events ( )

Drain event queue, invoke callbacks (call on engine thread).

Drain event queue, invoke callbacks on engine thread.

Version
1.8.7

Definition at line 118 of file health_monitor.cpp.

◆ set_status_callback()

void entropic::HealthMonitor::set_status_callback ( StatusCallback  cb)

Set callback for status change events.

Parameters
cbCallback invoked by process_events().
Version
1.8.7
Parameters
cbCallback.

Definition at line 78 of file health_monitor.cpp.

◆ start()

void entropic::HealthMonitor::start ( )

Start the monitoring thread.

Version
1.8.7

Definition at line 87 of file health_monitor.cpp.

◆ stop()

void entropic::HealthMonitor::stop ( )

Stop monitoring and all reconnection attempts.

Version
1.8.7

Definition at line 102 of file health_monitor.cpp.

◆ unwatch()

void entropic::HealthMonitor::unwatch ( const std::string &  name)

Stop monitoring a server.

Parameters
nameServer name.
Version
1.8.7
Parameters
nameServer name.

Definition at line 66 of file health_monitor.cpp.

◆ watch()

void entropic::HealthMonitor::watch ( const std::string &  name,
ExternalMCPClient client 
)

Start monitoring a server.

Parameters
nameServer name.
clientNon-owning pointer to ExternalMCPClient.
Version
1.8.7
Parameters
nameServer name.
clientNon-owning pointer.

Definition at line 44 of file health_monitor.cpp.


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