Commit 1845fd4
zycas
feat: add GatewayRpcConnectionPool for WS connection reuse
Implements WebSocket connection pooling (Issue #32, approach 2) to
reduce per-dispatch latency from ~100-200ms overhead to near-zero
for subsequent requests on the same gateway config.
- GatewayRpcConnectionPool class with acquire/release lifecycle
- Idle eviction timer (default 5min) to free unused connections
- Heartbeat ping via echo RPC to keep connections alive
- Auto-reconnect on dead socket detection
- Full stats tracking (hit rate, acquires, reuses, reconnects)
- 12 unit tests covering reuse, eviction, reconnect, stats, destroy
- Export GatewayRpcConnection class for testability1 parent 9a49e82 commit 1845fd4
4 files changed
Lines changed: 997 additions & 554 deletions
0 commit comments