send

abstract suspend fun send(event: ServerSentEvent)

Sends a ServerSentEvent to the client.


open suspend fun send(data: String? = null, event: String? = null, id: String? = null, retry: Long? = null, comments: String? = null)

Creates and sends a ServerSentEvent to the client.

Parameters

data

data field of the event.

event

string identifying the type of event.

id

event ID.

retry

reconnection time, in milliseconds to wait before reconnecting.

comments

comment lines starting with a ':' character.