WebSocketHub
Sovereign Physical Distribution Platform · Cluster Node
Low-latency bidirectional WebSocket connection pool delivering live telemetry, order status updates, and dispatch broadcasts.
The Pegasus WebSocket Hub maintains persistent, authenticated connections with tens of thousands of active client terminals. Role-based channel subscriptions allow clients to receive only the events relevant to their operational zone, eliminating polling overhead.
Architecture & Performance Highlights
Role-Scoped Channels
Clients subscribe to topics like cell:uz:orders, driver:uuid:route, or warehouse:uuid:dock.
Sub-40ms Delivery
Optimized Go Gorilla/Nhooyr WebSocket servers forward events with minimal memory overhead.
Heartbeat & Resync
30-second ping/pong frames with automatic reconnection and missed-event sequence backfill.
Sequence Number Backfill
Every WebSocket event includes an incrementing seq_id. If a client disconnects briefly, it sends its last received seq_id to replay missed messages.
Keep Exploring Pegasus Architecture & Operations
Based on the invariants, physical actors, and data flows of this module, explore these recommended companion guides and operational playbooks.
Transactional Outbox & Bus
Understand how database transactions feed the outbox worker that publishes to the WebSocket hub.
REST API & Scopes
WebSocket authentication tokens are obtained via the standard REST login endpoint.
