Scoop API

scoop:scoop.http.client:0.1.0

HttpSseReconnectOptions

class HttpSseReconnectOptions

source · line 39
public
public class HttpSseReconnectOptions internal constructor(
    /**
     * The initial reconnect delay before a server retry hint.
     */
    public val initialDelay: Duration = Duration.seconds(3L),
    /**
         * The maximum selected reconnect delay.
         */
    public val maxDelay: Duration = Duration.seconds(30L),
    /**
     * Optional maximum reconnect count; None leaves the count unbounded.
     */
    public val maxReconnects: Long? = None,
    /**
     * Suspend callback receiving the next reconnect decision.
     */
    public val onReconnect: suspend (HttpSseReconnect) -> Unit = suspend { _ -> }
)

Cancellable SSE reconnection delays, optional attempt bound, and a callback before reconnecting.

Extensions

property initialDelay

source · line 43
public
public val initialDelay: Duration = Duration.seconds(3L)

get: public read-only

The initial reconnect delay before a server retry hint.

property maxReconnects

source · line 51
public
public val maxReconnects: Long? = None

get: public read-only

Optional maximum reconnect count; None leaves the count unbounded.

property onReconnect

source · line 55
public
public val onReconnect: suspend (HttpSseReconnect) -> Unit = suspend { _ -> }

get: public read-only

Suspend callback receiving the next reconnect decision.