SSESession

interface SSESession : CoroutineScope

A session for handling Server-Sent Events (SSE) from a server.

Example of usage:

client.sse("http://localhost:8080/sse") { // `this` is `ClientSSESession`
    incoming.collect { event ->
        println("Id: ${event.id}")
        println("Event: ${event.event}")
        println("Data: ${event.data}")
    }
}

To learn more, see the SSE and the SSE specification.

Report a problem

Inheritors

Properties

Link copied to clipboard
Link copied to clipboard
abstract val incoming: Flow<ServerSentEvent>

An incoming Server-Sent Events (SSE) flow.