ReconnectConfigBuilder

class ReconnectConfigBuilder

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.

Properties

Link copied to clipboard
var delayStrategy: RetryDelayStrategy

Defines the time to wait before each reconnection attempt.

Link copied to clipboard
var maxAttempts: Int

The maximum number of reconnection attempts before giving up.