Freshen::Broker
Thread-safe pub/sub Server-Sent Events (SSE) stream broker. Manages active client stream connections, concurrent non-blocking broadcasts, dead socket pruning, and periodic keep-alive heartbeats.
Constructors
new(heartbeat_interval : Time::Span = 15.seconds)
SourceInstance methods
broadcast(event : Event) : Nil
Broadcasts a structured SSE Event payload to all connected clients.
Broadcasts a raw SSE payload string to all connected clients concurrently.
heartbeat_interval
SourceRegisters an IO stream with an explicit client identifier.
running?
SourceSubscribes an IO stream with an auto-generated or explicit client identifier.