WebSocket & Real-time

Broadcast WebSocket updates and SSE events to client applications.

6|1|Updated Dec 12, 2019
One-click install
npx skills add https://github.com/ikeniborn/familyBudget --skill websocket-real-time
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: WebSocket & Real-time
Source: https://github.com/ikeniborn/familyBudget/tree/main/.claude/skills/websocket-realtime
Command: npx skills add https://github.com/ikeniborn/familyBudget --skill websocket-real-time

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enables instant, bidirectional updates between servers and clients using WebSocket and SSE, reducing latency and keeping UIs in sync without manual polling.

Core Features & Use Cases

  • WebSocket broadcast to endpoints after data mutations to push changes in real time
  • SSE polling with an event_buffer to ensure all clients receive events even during reconnections
  • Frontend integration through a dedicated budgetWSClient.js to standardize event handling
  • Architectural guidance for single-worker reliability and future multi-worker scaling with Redis Pub/Sub

Quick Start

Connect a WebSocket client to budgetWSClient.js and configure your endpoints to emit WebSocket events after mutations.

Frequently Asked Questions about WebSocket & Real-time

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I broadcast real-time updates to multiple frontend clients after data mutations?

You can broadcast real-time updates to multiple frontend clients by emitting WebSocket events immediately after backend data mutations. This approach pushes changes directly to connected UIs, ensuring instant synchronization without manual polling.

What is the best way to handle SSE reconnections without losing events?

The best way to handle SSE reconnections without losing events is by utilizing an event_buffer. This mechanism stores events temporarily, ensuring that clients receive any missed event data automatically upon successfully reconnecting to the server.

How does WebSocket broadcast work under a single-worker constraint?

WebSocket broadcast operates under a single-worker constraint by relying on in-memory distribution to route events to connected clients. This architectural choice ensures reliable message delivery within a single process before requiring external scaling solutions.

Do I need Redis Pub/Sub to scale WebSocket broadcasting for multi-worker deployments?

You need Redis Pub/Sub to scale WebSocket broadcasting across multi-worker deployments. The in-memory distribution works for a single worker, but Redis is required to synchronize events and broadcast messages reliably across multiple server instances.

How do I integrate frontend applications with WebSocket and SSE broadcasting?

You integrate frontend applications by connecting a dedicated client, such as budgetWSClient.js, to standardize event handling. This script manages WebSocket connections and SSE polling, ensuring your UI receives and processes real-time updates consistently.

When should I choose SSE over WebSocket for real-time frontend updates?

You should consider SSE for scenarios requiring reliable event streaming with built-in reconnection buffering, while WebSocket is better suited for bidirectional communication. This Skill supports both, allowing you to push changes via WebSockets and buffer SSE events.