Expand description
Health-based watchdog integration
Provides a health checker that only pings the systemd watchdog when the service is healthy. If health checks fail, the watchdog won’t be pinged and systemd will eventually restart the service.
§Architecture
┌─────────────────────────────────────────────┐
│ HealthChecker │
│ ┌─────────────────────────────────────┐ │
│ │ check_zmq_connectivity() │ │
│ │ check_http_endpoint() │ │
│ │ check_memory_pressure() │ │
│ └─────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────┐ │
│ │ is_healthy() -> bool │ │
│ │ (all checks must pass) │ │
│ └─────────────────────────────────────┘ │
└─────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────┐
│ run_watchdog() │
│ if is_healthy() { SystemdNotifier::watchdog() }
└─────────────────────────────────────────────┘§Usage
ⓘ
use hyprstream_core::systemd::health::{HealthChecker, run_watchdog};
let checker = HealthChecker::new();
// Spawn watchdog task (runs until shutdown)
tokio::spawn(run_watchdog(checker));Structs§
- Health
Checker - Health checker for watchdog integration
- Health
Config - Health check configuration
Functions§
- run_
watchdog - Run the watchdog task
- run_
watchdog_ with_ shutdown - Run watchdog with a shutdown signal