Scoop API

scoop:scoop.http.client:0.1.0

HttpEventSource

class HttpEventSource

source · line 138
public
public class HttpEventSource internal constructor(
    private val state: ClientSseState,
    private val info: ClientSseInfo
) : 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.

function close

source · line 188
public
public override suspend fun close(): Unit

Cancels pending reads/reconnects and awaits stream and call cleanup.

function next

source · line 184
public
public suspend fun next(): SseEvent?

Returns the next event, suspending through enabled reconnects, or None when event production ends. Only one reader may be active.