class HttpSseReconnectOptions
source · line 39public
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
public fun HttpSseReconnectOptions.copy(configure: HttpSseReconnectOptionsBuilder.() -> Unit = {}): HttpSseReconnectOptions· scoop:scoop.http.client:0.1.0
property initialDelay
source · line 43public
public val initialDelay: Duration = Duration.seconds(3L)
get: public read-only
The initial reconnect delay before a server retry hint.
property maxReconnects
source · line 51public
public val maxReconnects: Long? = None
get: public read-only
Optional maximum reconnect count; None leaves the count unbounded.
property maxDelay
source · line 47public
public val maxDelay: Duration = Duration.seconds(30L)
get: public read-only
The maximum selected reconnect delay.
property onReconnect
source · line 55public
public val onReconnect: suspend (HttpSseReconnect) -> Unit = suspend { _ -> }
get: public read-only
Suspend callback receiving the next reconnect decision.