# http/sse-send Send one Server-Sent Event on a stream. Multi-line data is split into one `data:` line per line. ## Syntax
[http/sse-send $stream data ?opts]
## Parameters - `$stream` — `%SseStream{}` from `http/sse` - `$data` — event payload (string); trailing `\r` is trimmed per line - `$opts` — optional map: `:event` name, `:id` id ## Examples
[http/sse-send $s "hello"]                                   # → true
[http/sse-send $s "line1\nline2" %{ :event "tick" :id "42" }]
set r [http/sse-send $s "late"]                              # after close
[err? $r]                                                    # → true
## Returns `true`; `%Err{:message}` when the stream is closed, the first argument is not a stream, `$data` is not a string, or the client is too slow (pending output above 1 MiB — the stream is closed rather than buffering without bound). ## See Also `http/sse`, `http/sse-comment`, `http/sse-close`