Spikard. SseEvent
(spikard v0.15.6-rc.6)
Copy Markdown
An individual SSE event
Represents a single Server-Sent Event to be sent to a connected client. Events can have an optional type, ID, and retry timeout for advanced scenarios.
Fields
event_type- Optional event type string (used for client-side event filtering)data- JSON data payload to send to the clientid- Optional event ID (clients can use this to resume after disconnect)retry- Optional retry timeout in milliseconds (tells client when to reconnect)
SSE Format
Events are serialized to the following text format:
event: event_type
data: {"json":"value"}
id: event-123
retry: 3000
Summary
Types
@type t() :: %Spikard.SseEvent{ data: String.t() | nil, event_type: String.t() | nil, id: String.t() | nil, retry: non_neg_integer() | nil }
An individual SSE event