CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/realtime-web-patterns

WebSocket vs SSE vs polling, reconnection with backoff and jitter, heartbeats, backpressure, message ordering, connection state UI, auth on upgrade, graceful degradation

94

1.87x
Quality

98%

Does it follow best practices?

Impact

90%

1.87x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

backpressure-handled.jsonverifiers/

{
  "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"
    }
  ]
}

tile.json