WebsocketClientOptionsBuilder
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Defined in: src/http/websocket/WebsocketClientOptions.ts:51
Fluent builder for WebsocketClientOptionsType.
Extends
Section titled “Extends”BrokerOptionsBuilder<WebsocketClientOptionsType<TOut,TIn>>
Type Parameters
Section titled “Type Parameters”TOut = unknown
TIn = unknown
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WebsocketClientOptionsBuilder<
TOut,TIn>():WebsocketClientOptionsBuilder<TOut,TIn>
Returns
Section titled “Returns”WebsocketClientOptionsBuilder<TOut, TIn>
Inherited from
Section titled “Inherited from”BrokerOptionsBuilder<WebsocketClientOptionsType<TOut, TIn>>.constructor
Methods
Section titled “Methods”build()
Section titled “build()”build():
Partial<T>
Defined in: src/util/OptionsBuilder.ts:51
Snapshot the set fields as an independent Partial<T> (own props only).
Returns
Section titled “Returns”Partial<T>
Inherited from
Section titled “Inherited from”BrokerOptionsBuilder.build
withCircuitBreaker()
Section titled “withCircuitBreaker()”withCircuitBreaker(
failureThreshold,resetMs):this
Defined in: src/io/broker/BrokerOptions.ts:125
Circuit breaker around connect attempts.
Parameters
Section titled “Parameters”failureThreshold
Section titled “failureThreshold”number
resetMs
Section titled “resetMs”number
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”BrokerOptionsBuilder.withCircuitBreaker
withCodec()
Section titled “withCodec()”withCodec(
codec):this
Defined in: src/http/websocket/WebsocketClientOptions.ts:69
Wire codec. Default: jsonCodec<TOut, TIn>().
Parameters
Section titled “Parameters”WebsocketCodec<TOut, TIn>
Returns
Section titled “Returns”this
withMaxFrameBytes()
Section titled “withMaxFrameBytes()”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.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”this
withOnInvalidMessage()
Section titled “withOnInvalidMessage()”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’.
Parameters
Section titled “Parameters”policy
Section titled “policy”"disconnect" | "drop" | "hook"
Returns
Section titled “Returns”this
withOutboundBuffer()
Section titled “withOutboundBuffer()”withOutboundBuffer(
limit):this
Defined in: src/io/broker/BrokerOptions.ts:130
Outbound buffer size (messages held while disconnected). Default 1000; 0 = fail-fast.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”BrokerOptionsBuilder.withOutboundBuffer
withPingIntervalMs()
Section titled “withPingIntervalMs()”withPingIntervalMs(
ms):this
Defined in: src/http/websocket/WebsocketClientOptions.ts:84
Send a ping every ms to keep the connection alive. Default: disabled.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”this
withProtocols()
Section titled “withProtocols()”withProtocols(
protocols):this
Defined in: src/http/websocket/WebsocketClientOptions.ts:64
Sub-protocol(s) offered in the handshake.
Parameters
Section titled “Parameters”protocols
Section titled “protocols”string | readonly string[]
Returns
Section titled “Returns”this
withReconnect()
Section titled “withReconnect()”withReconnect(
policy):this
Defined in: src/io/broker/BrokerOptions.ts:120
Reconnect policy (or false to disable auto-reconnect).
Parameters
Section titled “Parameters”policy
Section titled “policy”false | { factor?: number; initialDelayMs?: number; maxAttempts?: number; maxDelayMs?: number; } | undefined
false
Type Literal
Section titled “Type Literal”{ factor?: number; initialDelayMs?: number; maxAttempts?: number; maxDelayMs?: number; }
factor?
Section titled “factor?”number
initialDelayMs?
Section titled “initialDelayMs?”number
maxAttempts?
Section titled “maxAttempts?”number
Cap on retry attempts. Default: Infinity (retry forever).
maxDelayMs?
Section titled “maxDelayMs?”number
undefined
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”BrokerOptionsBuilder.withReconnect
withUrl()
Section titled “withUrl()”withUrl(
url):this
Defined in: src/http/websocket/WebsocketClientOptions.ts:59
WebSocket URL (ws://… or wss://…). Required (here or via HOCON).
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”this
create()
Section titled “create()”
staticcreate<TOut,TIn>():WebsocketClientOptionsBuilder<TOut,TIn>
Defined in: src/http/websocket/WebsocketClientOptions.ts:54
Start a fresh builder. Equivalent to new WebsocketClientOptionsBuilder().
Type Parameters
Section titled “Type Parameters”TOut = unknown
TIn = unknown
Returns
Section titled “Returns”WebsocketClientOptionsBuilder<TOut, TIn>
