Skip to main content
Version: v0.0.3

Interface: StarterClientOptions

Options for createStarterClient.

The starter applies opinionated defaults on top of ClientOptions, so every override here is optional except host + port. The starter-specific addition is handleSignals (mirrors createStarterServer).

Example

const opts: StarterClientOptions = {
host: 'localhost',
port: 2575,
onMessage: (payload) => logger.info({ bytes: payload.length }),
handleSignals: true,
};

Properties

ackTimeoutMs?

readonly optional ackTimeoutMs?: number

Override default 30_000.


autoReconnect?

readonly optional autoReconnect?: boolean

Override default true (auto-reconnect on transient errors).


correlateByControlId?

readonly optional correlateByControlId?: boolean

Override default false (FIFO mode).


deadPeerTimeoutMs?

readonly optional deadPeerTimeoutMs?: number

Application-idle dead-peer timeout ms.


drainTimeoutMs?

readonly optional drainTimeoutMs?: number

Drain timeout for close() (default 30_000).


framing?

readonly optional framing?: Omit<FrameReaderOptions, "onFrame" | "onWarning">

FrameReader options (passthrough).


handleSignals?

readonly optional handleSignals?: boolean

Register process SIGTERM/SIGINT handlers that close the client. Default false. When true, SIGTERM/SIGINT both call client.close() and exit the process. Handlers self-deregister on 'close'.


highWaterMark?

readonly optional highWaterMark?: HighWaterMark

Override default 64.


host

readonly host: string

Host to connect to.


keepaliveIntervalMs?

readonly optional keepaliveIntervalMs?: number

TCP keepalive interval ms.


onBackpressure?

readonly optional onBackpressure?: "reject" | "wait"

Override default 'reject'.


onMessage?

readonly optional onMessage?: (payload) => void

Inbound-message callback (any framed payload from the peer, including non-ACK messages on bidirectional channels). Mirrors the server-side onMessage ergonomics.

Parameters

payload

Buffer

Returns

void


pipeline?

readonly optional pipeline?: boolean

Override default true (parallel up to highWaterMark).


port

readonly port: number

TCP port.


retryStrategy?

readonly optional retryStrategy?: RetryStrategy

Custom reconnect-backoff hook.


tls?

readonly optional tls?: true | TlsOptions

Enable TLS (MLLPS) for this connection. Passthrough to ClientOptions.tls.