class HttpEventSource
source · line 138public class HttpEventSource internal constructor(
private val state: ClientSseState,
private val info: ClientSseInfo
) : AsyncCloseable
- Supertype
AsyncCloseable
An owned serial SSE event source. It tracks last-event ID and retry delay across explicitly enabled reconnects; close cancels and awaits pending work.
property isFinished
source · line 165public val isFinished: Boolean
get: public read-only
Whether event production has reached its terminal state.
getter get
source · line 165get(): Boolean
function close
source · line 188public override suspend fun close(): Unit
- Overrides
close
Cancels pending reads/reconnects and awaits stream and call cleanup.
property isClosed
source · line 169public val isClosed: Boolean
get: public read-only
Whether explicit close has completed.
getter get
source · line 169get(): Boolean
property failure
source · line 173public val failure: Throwable?
get: public read-only
The terminal stream or cleanup failure, if any.
getter get
source · line 173get(): Option<Throwable>
property lastEventId
source · line 153public val lastEventId: String
get: public read-only
The persistent last-event ID.
getter get
source · line 153get(): String
property retryDelay
source · line 157public val retryDelay: Duration
get: public read-only
The currently selected reconnect delay.
getter get
source · line 157get(): Duration
function next
source · line 184public suspend fun next(): SseEvent?
Returns the next event, suspending through enabled reconnects, or None when event production ends. Only one reader may be active.
property url
source · line 145public val url: Url
get: public read-only
The current stream's final URL, updated after reconnects.
getter get
source · line 145get(): Url
property head
source · line 149public val head: HttpResponseHead
get: public read-only
The current stream's response head.
getter get
source · line 149get(): HttpResponseHead
property reconnectCount
source · line 161public val reconnectCount: Long
get: public read-only
The number of reconnects performed.
getter get
source · line 161get(): Long