OptionalheadersAdditional response headers such as CORS or Vary.
OptionalheartbeatInterval for SSE heartbeat comments. Defaults to 25 seconds. Set to
false to disable heartbeats.
OptionalmaxMaximum bytes of unread event data held by the response stream. Defaults to 1 MiB. The connection closes when one frame or the accumulated queue would exceed this limit.
OptionalmaxClose the connection after this duration so clients can reconnect and reconcile. Disabled by default.
OptionalsignalAbort the stream with the surrounding request or application lifecycle.
OptionalonObserve producer, serialization, buffer, stream, or cleanup failures.
Expected AbortError rejections caused by stream closure are ignored.
Begin producing events. Return a cleanup callback or closeable subscription for resources associated with this connection. Pending asynchronous setup does not block response cancellation; honor the stream signal and return cleanup when setup settles.
Options for
createServerSentEventResponse(...).