Skip to main content
Version: Next

Type Alias: ReconnectOptions

ReconnectOptions = object

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

Options for configuring the automatic reconnection behavior of the WebSocketChannel.

Properties

retries?

optional retries?: number

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

The number of retries to attempt before giving up.

Default

5

delay?

optional delay?: number

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

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:91

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:99

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