ReconnectConfigBuilder

Properties

Link copied to clipboard

Defines the time to wait before each reconnection attempt.

Link copied to clipboard

The maximum number of reconnection attempts before giving up.

Link copied to clipboard

An additional coroutine context for the coroutine that handles reconnections.

Functions

Link copied to clipboard
fun afterReconnect(body: suspend (WebSocketConnection) -> Unit)

A callback called each time the web socket is successfully reconnected.

Link copied to clipboard
fun reconnectWhen(predicate: suspend (exception: Throwable, attempt: Int) -> Boolean)

Registers a predicate to decide whether the web socket should be reconnected when the given exception occur. The attempt parameter is the index of the current reconnection attempt in a series of retries.