Skip to main content

Module sse

Module sse 

Source
Expand description

Server-Sent Events (SSE) response builder.

Builds a hyper::Response with Content-Type: text/event-stream and streams events from an InMemoryQueueReader as SSE frames.

Structs§

SseBodyWriter
Wraps an mpsc::Sender for writing SSE frames to a response body.

Functions§

build_sse_response
Builds an SSE streaming response from an event queue reader.
write_event
Formats a single SSE frame with the given event type and data.
write_keep_alive
Formats a keep-alive SSE comment.