WebSocket vs SSE vs polling, reconnection with backoff and jitter, heartbeats, backpressure, message ordering, connection state UI, auth on upgrade, graceful degradation
94
98%
Does it follow best practices?
Impact
90%
1.87xAverage score across 5 eval scenarios
Passed
No known issues
{
"instruction": "Handle backpressure from slow consumers to prevent server memory exhaustion",
"relevant_when": "Agent implements WebSocket or SSE server that broadcasts messages to multiple connected clients",
"context": "When a client cannot read messages fast enough, the server's send buffer grows unbounded and the server runs out of memory. The server must check bufferedAmount (WebSocket) or write() return value (SSE/streams) and drop or pause slow consumers.",
"sources": [
{
"type": "file",
"filename": "skills/realtime-web-patterns/SKILL.md",
"tile": "tessl-labs/realtime-web-patterns@0.2.0"
}
],
"checklist": [
{
"name": "buffer-check-before-send",
"rule": "Before sending to a WebSocket client, check ws.bufferedAmount and either skip the message or disconnect the client if the buffer exceeds a threshold. For SSE, check the return value of res.write() for backpressure signals.",
"relevant_when": "Agent implements broadcast/fan-out to multiple real-time clients"
},
{
"name": "slow-client-eviction",
"rule": "Clients that consistently cannot keep up are disconnected with a meaningful close code/reason rather than letting their buffer grow indefinitely",
"relevant_when": "Agent implements high-throughput real-time broadcasting"
}
]
}evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
skills
realtime-web-patterns
verifiers