What problem does it solve?
This Skill addresses the challenge of setting up and managing real-time event streams with async generator subscriptions in server-side applications, focusing on server-side event handling and client-side subscription management.
Core Features & Use Cases
- Async Generator Subscriptions: Set up event streams using
.subscription(async function*() { yield }).
- Server-Side Event Handling: Provides instructions for server-side event handling with SSE via
httpSubscriptionLink.
- Client-Side Subscription Management: Demonstrates client-side subscription setup with
splitLink and httpSubscriptionLink.
- Reconnection Recovery: Utilizes
tracked(id, data) from @trpc/server for reconnection recovery with lastEventId.
- WebSocket and SSE: Configures WebSocket via
wsLink and createWSClient from @trpc/client, and applyWSSHandler from @trpc/server/adapters/ws.
- Use Case: This Skill is ideal for developers looking to add real-time updates to their applications, such as live data feeds, real-time notifications, or live chat functionality.
Quick Start
Use the subscriptions skill to create a subscription to a real-time event stream and process events as they occur.