Zum Inhalt springen
Deutsch

ClusterRouterOptionsBuilder

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Defined in: src/cluster/router/ClusterRouterOptions.ts:82

Fluent builder for ClusterRouterOptionsType:

const routerOptions = ClusterRouterOptions.create<Command>()
.withCluster(cluster)
.withRouterType('consistent-hashing')
.withRouteePath('/user/worker')
.withExtractKey((m) => m.id);
ClusterRouter.factory(routerOptions);

TMessage

new ClusterRouterOptionsBuilder<TMessage>(): ClusterRouterOptionsBuilder<TMessage>

ClusterRouterOptionsBuilder<TMessage>

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


withCluster(cluster): this

Defined in: src/cluster/router/ClusterRouterOptions.ts:89

The cluster the router lives in — drives membership + transport.

Cluster

this


withExtractKey(extractKey): this

Defined in: src/cluster/router/ClusterRouterOptions.ts:109

Key extractor — required for consistent-hashing, ignored otherwise.

(message) => string

this


withMailboxDepthRefreshMs(mailboxDepthRefreshMs): this

Defined in: src/cluster/router/ClusterRouterOptions.ts:114

Refresh interval for the cached mailbox depths — smallest-mailbox only.

number

this


withMailboxDepthStaleAfterMs(mailboxDepthStaleAfterMs): this

Defined in: src/cluster/router/ClusterRouterOptions.ts:119

Age at which a cached depth stops counting; 0 disables the expiry.

number

this


withRole(role): this

Defined in: src/cluster/router/ClusterRouterOptions.ts:94

Restrict routees to up-members carrying this role. Omit for “any node”.

string

this


withRouteePath(routeePath): this

Defined in: src/cluster/router/ClusterRouterOptions.ts:104

The path the routee actor lives under on each node — usually /user/<name>.

string

this


withRouterType(routerType): this

Defined in: src/cluster/router/ClusterRouterOptions.ts:99

Routing strategy. See ClusterRouterType.

ClusterRouterType

this


static create<TMessage>(): ClusterRouterOptionsBuilder<TMessage>

Defined in: src/cluster/router/ClusterRouterOptions.ts:84

Start a fresh builder.

TMessage

ClusterRouterOptionsBuilder<TMessage>