Ir al contenido
Español

WebsocketClientOptionsBuilder

Esta página aún no está disponible en tu idioma.

Defined in: src/http/websocket/WebsocketClientOptions.ts:51

Fluent builder for WebsocketClientOptionsType.

TOut = unknown

TIn = unknown

new WebsocketClientOptionsBuilder<TOut, TIn>(): WebsocketClientOptionsBuilder<TOut, TIn>

WebsocketClientOptionsBuilder<TOut, TIn>

BrokerOptionsBuilder<WebsocketClientOptionsType<TOut, TIn>>.constructor

build(): Partial<T>

Defined in: src/util/OptionsBuilder.ts:51

Snapshot the set fields as an independent Partial<T> (own props only).

Partial<T>

BrokerOptionsBuilder.build


withCircuitBreaker(failureThreshold, resetMs): this

Defined in: src/io/broker/BrokerOptions.ts:125

Circuit breaker around connect attempts.

number

number

this

BrokerOptionsBuilder.withCircuitBreaker


withCodec(codec): this

Defined in: src/http/websocket/WebsocketClientOptions.ts:69

Wire codec. Default: jsonCodec<TOut, TIn>().

WebsocketCodec<TOut, TIn>

this


withMaxFrameBytes(bytes): this

Defined in: src/http/websocket/WebsocketClientOptions.ts:74

Inbound frame size cap; oversize frames are dropped with a warning. Default 1 MiB.

number

this


withOnInvalidMessage(policy): this

Defined in: src/http/websocket/WebsocketClientOptions.ts:79

What to do with an inbound frame the codec can’t decode. Default ‘drop’.

"disconnect" | "drop" | "hook"

this


withOutboundBuffer(limit): this

Defined in: src/io/broker/BrokerOptions.ts:130

Outbound buffer size (messages held while disconnected). Default 1000; 0 = fail-fast.

number

this

BrokerOptionsBuilder.withOutboundBuffer


withPingIntervalMs(ms): this

Defined in: src/http/websocket/WebsocketClientOptions.ts:84

Send a ping every ms to keep the connection alive. Default: disabled.

number

this


withProtocols(protocols): this

Defined in: src/http/websocket/WebsocketClientOptions.ts:64

Sub-protocol(s) offered in the handshake.

string | readonly string[]

this


withReconnect(policy): this

Defined in: src/io/broker/BrokerOptions.ts:120

Reconnect policy (or false to disable auto-reconnect).

false | { factor?: number; initialDelayMs?: number; maxAttempts?: number; maxDelayMs?: number; } | undefined

false


{ factor?: number; initialDelayMs?: number; maxAttempts?: number; maxDelayMs?: number; }

number

number

number

Cap on retry attempts. Default: Infinity (retry forever).

number


undefined

this

BrokerOptionsBuilder.withReconnect


withUrl(url): this

Defined in: src/http/websocket/WebsocketClientOptions.ts:59

WebSocket URL (ws://… or wss://…). Required (here or via HOCON).

string

this


static create<TOut, TIn>(): WebsocketClientOptionsBuilder<TOut, TIn>

Defined in: src/http/websocket/WebsocketClientOptions.ts:54

Start a fresh builder. Equivalent to new WebsocketClientOptionsBuilder().

TOut = unknown

TIn = unknown

WebsocketClientOptionsBuilder<TOut, TIn>