Hello, heartbeat, resumeDiscord GatewayWebSocket → HELLO with heartbeat interval → IDENTIFY or RESUME
Discord's developer docs describe a WebSocket gateway: the server's first message (HELLO) tells the client how often to send a heartbeat, every event carries a sequence number, and a dropped client can send a RESUME with its last sequence number and session id to have the missed events replayed instead of starting over.
Documented limitsAmazon API Gateway WebSocketidle timeout 10 minutes · connection duration 2 hours
AWS documents quotas for API Gateway's WebSocket APIs: an idle connection is closed after 10 minutes, and a connection can last at most 2 hours, after which the client must reconnect. Any managed push service has limits like these, so clients must be written to reconnect and resume.
A million on one boxWhatsAppphone → Erlang server holding the connection
WhatsApp's engineers published that single servers held more than a million simultaneous connections, tuning the OS (file descriptors, buffers) and the Erlang runtime. It is the standard reference that persistent connections at huge scale are an engineering problem you can solve, not a reason to avoid push.
Built into the browserSSE (WHATWG HTML standard)EventSource → text/event-stream → Last-Event-ID
The HTML standard defines Server-Sent Events: the EventSource API opens a long-lived text/event-stream response, reconnects automatically after a delay the server can set, and sends the last event id in a Last-Event-ID header so the server can resume. It is the simplest standard for one-way push.