SSE Streams
Esta página aún no está disponible en tu idioma.
SSE routes open a persistent HTTP connection and push a sequence of named events to the client on a configurable interval. No extra dependencies — yRest uses Node.js native streams and Fastify’s raw reply API.
Declaring an SSE route
Section titled “Declaring an SSE route”The _sse block
Section titled “The _sse block”Event structure
Section titled “Event structure”Looping and repeat
Section titled “Looping and repeat”Interval
Section titled “Interval”Template variables per frame
Section titled “Template variables per frame”Keep-alive
Section titled “Keep-alive”Wire format
Section titled “Wire format”Examples
Section titled “Examples”Next steps
Section titled “Next steps”- Template Variables —
{{now}}and{{uuid}}are especially useful in SSE data - Handler Functions — handler-based SSE for fully dynamic streams (Phase 12B)
- WebSocket — bidirectional mock channels (coming soon)