subatom-pulse is an enterprise-grade WebSocket engine designed for Node.js 24+ runtimes. It provides completely isolated connection lifecycles, structured JSON wire packet enforcement, deterministic outbound queue memory bounds, and native room routing without the bloat of HTTP fallback transports.
ws. It is not Socket.IO compatible: the protocol is pure JSON WebSocket traffic with no HTTP long-polling overhead.Every connection is an independent entity holding its own lifecycle state machine, bounded FIFO outbound buffer, and tracked event registry. A slow client never affects another client.
Rooms are indexed sets in memory managed by RoomRegistry. Joining and leaving operates in O(1) complexity, and all rooms are automatically pruned on disconnect.
Outgoing traffic does not bloat process memory unchecked. Strict memory ceilings (maxQueueBytes) and policies (drop-oldest, reject) govern every frame.
┌────────────────┐ HTTP Upgrade (Authenticator) ┌─────────────────────────┐
│ Client Connect │ ──────────────────────────────────> │ SocketServer Admission │
└────────────────┘ └────────────┬────────────┘
│ Authenticated
▼
┌──────────────────┐ Microtask Dequeue ┌─────────────────────────────────────┐
│ WebSocket.send() │ <─────────────────── │ OutboundQueue (Per-Client Limits) │
└──────────────────┘ └──────────────────┬──────────────────┘
▲
│ Packets Enqueued
┌──────────────────┐ Middleware Execution ┌─────────────┴──────────────────┐
│ Event Handlers │ <───────────────────────── │ PacketDecoder & Validator │
└──────────────────┘ └────────────────────────────────┘reject, drop-oldest, drop-newest, and disconnect are explicit per-connection policies.installSignalHandlers() installs idempotent SIGTERM and SIGINT handlers.