Skip to main content
Version: 11.x

Type Alias: ReconnectOptions

ReconnectOptions = object

Defined in: src/channel/ws/ws_0_10.ts:72

Options for configuring the automatic reconnection behavior of the WebSocketChannel.

Properties​

retries?​

optional retries?: number

Defined in: src/channel/ws/ws_0_10.ts:77

The number of retries to attempt before giving up.

Default​

5

delay?​

optional delay?: number

Defined in: src/channel/ws/ws_0_10.ts:82

The initial delay in milliseconds before the first retry.

Default​

2000

exponential?​

optional exponential?: number | boolean

Defined in: src/channel/ws/ws_0_10.ts:87

Whether to use the exponential backoff (delay being doubled for each subsequent retry).

Default​

true

stableConnectionThreshold?​

optional stableConnectionThreshold?: number

Defined in: src/channel/ws/ws_0_10.ts:95

The minimum time in milliseconds a reconnected connection must stay open before it is considered stable and the retry counter is reset. This prevents a gateway that accepts the connection then immediately drops it (a "flapping" connection) from resetting the counter on every cycle and reconnecting forever.

Default​

5000