Expand description
§Connection pool
Bounded IPC connection pool with health monitoring,
lifetime / idle cleanup, and statistics. The
Pool::Struct aggregator + giant impl lives in Pool.rs
(tightly-coupled cluster); the per-connection state, the
health-status enum, the config, the stats DTO, and the
background health checker each live in their own sibling.
Modules§
- Connection
Handle - Per-connection state - id, lifecycle timestamps, rolling
health score, error / success counters, and a
ConnectionHealth::Enumsummary.update_healthadjusts the score on each operation;is_healthydecides whether the pool can hand the connection out. - Connection
Health - Health classification for
ConnectionHandle::Struct-Healthy(default),Unhealthy(failed health check),Degraded(degraded but still usable). - Health
Checker - Per-connection health-probe helper used by
Pool::Struct::start_health_monitoring. Currently runs a simulated 10ms ping; real implementations would send a protocol-level keepalive. - Pool
Pool::Struct- bounded connection pool with health monitoring, idle/lifetime cleanup, wait-queue timeouts, and statistics. Acquire viaget_connection(drops a permit on the innerSemaphore); return viarelease_connection. The struct + 18-method impl + Clone + tests stay in one file - tightly coupled cluster.- Pool
Config - Connection-pool tunables: max / min connection counts plus the four millisecond budgets (acquire timeout, max lifetime, idle timeout, health-check interval).
- Pool
Stats - Aggregated pool counters surfaced to the dashboard - total / active / idle / healthy connection counts, queue size, average wait time, total / successful operation tallies, and the rolled-up error rate.