← all modules
module

stdlib::http::sse

defined in C:\Users\bye45\.glide\bin/src/stdlib/http/sse.glide

Build the wire bytes for one SSE event. Multiple `data: ...` lines

struct struct SseEvent
fn fn sse_format(e: SseEvent) -> string

Build the wire bytes for one SSE event. Multiple data: ... lines are emitted when data contains \n; the spec joins them on the client side.

glide
sse_format(SseEvent { event: "tick", data: "1", id: "" });
event: tick\ndata: 1\n\n
fn fn sse_response(source: *?) -> HttpResponse

Wrap source in a streaming response with the right Content-Type and cache-busting headers for SSE. Equivalent to:

HttpResponse::ok() .set("Content-Type", "text/event-stream") .set("Cache-Control", "no-cache") .set("X-Accel-Buffering", "no") .stream(source)