跳转到内容
简体中文

ClusterClientOptionsBuilder

此内容尚不支持你的语言。

Defined in: src/cluster/ClusterClientOptions.ts:41

Fluent builder for ClusterClientOptionsType:

new ClusterClient(
ClusterClientOptions.create()
.withContactPoints(['sys@127.0.0.1:2551'])
.withAskTimeoutMs(3_000),
);

new ClusterClientOptionsBuilder(): ClusterClientOptionsBuilder

ClusterClientOptionsBuilder

OptionsBuilder.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>

OptionsBuilder.build


withAskTimeoutMs(ms): this

Defined in: src/cluster/ClusterClientOptions.ts:63

Default ask timeout in ms. Default 5 s.

number

this


withClientIdentity(host, port): this

Defined in: src/cluster/ClusterClientOptions.ts:58

Host + port the client claims as its identity for reply routing.

string

number

this


withContactPoints(contactPoints): this

Defined in: src/cluster/ClusterClientOptions.ts:48

Cluster nodes to dial (host:port or <system>@host:port). Tried in order.

readonly string[]

this


withLogger(logger): this

Defined in: src/cluster/ClusterClientOptions.ts:73

Custom logger; default ConsoleLogger at WARN.

Logger

this


withSystemName(systemName): this

Defined in: src/cluster/ClusterClientOptions.ts:53

Synthetic system name embedded in the client’s hello. Default cluster-client.

string

this


withTls(tls): this

Defined in: src/cluster/ClusterClientOptions.ts:68

TLS config — must match the cluster’s.

TlsTransportOptionsType

this


static create(): ClusterClientOptionsBuilder

Defined in: src/cluster/ClusterClientOptions.ts:43

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

ClusterClientOptionsBuilder