|
Entropic 2.3.8
Local-first agentic inference engine
|
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). | |
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).
Definition at line 55 of file health_monitor.h.
| using entropic::HealthMonitor::StatusCallback = std::function<void(const HealthEvent&)> |
Callback invoked on engine thread when processing events.
Definition at line 61 of file health_monitor.h.
| entropic::HealthMonitor::HealthMonitor | ( | ReconnectPolicy | policy, |
| uint32_t | health_check_interval_ms = 0 |
||
| ) |
Construct with reconnection policy.
| policy | Backoff policy for reconnection attempts. |
| health_check_interval_ms | Ping interval (0 = disabled). |
| policy | Backoff policy. |
| health_check_interval_ms | Ping interval (0 = disabled). |
Definition at line 22 of file health_monitor.cpp.
| entropic::HealthMonitor::~HealthMonitor | ( | ) |
Destructor — stops monitor if running.
Definition at line 33 of file health_monitor.cpp.
| void entropic::HealthMonitor::process_events | ( | ) |
Drain event queue, invoke callbacks (call on engine thread).
Drain event queue, invoke callbacks on engine thread.
Definition at line 118 of file health_monitor.cpp.
| void entropic::HealthMonitor::set_status_callback | ( | StatusCallback | cb | ) |
Set callback for status change events.
| cb | Callback invoked by process_events(). |
| cb | Callback. |
Definition at line 78 of file health_monitor.cpp.
| void entropic::HealthMonitor::start | ( | ) |
| void entropic::HealthMonitor::stop | ( | ) |
Stop monitoring and all reconnection attempts.
Definition at line 102 of file health_monitor.cpp.
| void entropic::HealthMonitor::unwatch | ( | const std::string & | name | ) |
Stop monitoring a server.
| name | Server name. |
| name | Server name. |
Definition at line 66 of file health_monitor.cpp.
| void entropic::HealthMonitor::watch | ( | const std::string & | name, |
| ExternalMCPClient * | client | ||
| ) |
Start monitoring a server.
| name | Server name. |
| client | Non-owning pointer to ExternalMCPClient. |
| name | Server name. |
| client | Non-owning pointer. |
Definition at line 44 of file health_monitor.cpp.