SSEServerContent
class SSEServerContent( val call: ApplicationCall, val handle: suspend ServerSSESession.() -> Unit, val serialize: (TypeInfo, Any) -> String? = null) : OutgoingContent.WriteChannelContent
An OutgoingContent response object that could be used to respond()
. It will start Server-Sent events SSE session.
Please note that you generally shouldn't use this object directly but use SSE plugin with routing builders sse instead.
handle function is applied to a session.
Parameters
call
that is starting SSE session.
handle
function that is started once SSE session created.
Constructors
Link copied to clipboard
constructor(call: ApplicationCall, handle: suspend ServerSSESession.() -> Unit, serialize: (TypeInfo, Any) -> String? = null)