Node.js WebSockets can easily exhaust server RAM if a slow client (such as a mobile user on 2G) receives high-throughput broadcasts. subatom-pulse eliminates this through its microtask-scheduled OutboundQueue.
| Policy | Behavior on Queue Saturation | Recommended Production Use Case |
|---|---|---|
| reject | Rejects incoming push immediately. Returns false from sendPacket(); queue stays intact. | Default policy. Best for transactional, query, or CRUD request-reply streams. |
| drop-oldest | Shifts out older pending messages in FIFO order to accommodate new frames. | Stock tickers, real-time gaming position broadcasts, live analytics dashboards. |
| drop-newest | Discards the latest incoming message without perturbing the previously queued backlog. | Telemetry buffers where earlier state snapshots must be preserved. |
| disconnect | Immediately terminates the socket with WebSocket code 1008 (Backpressure violated). | Zero-tolerance enterprise financial feeds where stale delivery is illegal. |
maxQueueBytes (default 4MB) and maxQueueMessages (default 1,000) based on your maximum tolerated memory per connection multiplied by your concurrent connection target.