Zum Inhalt springen
Deutsch

ShardCoordinatorOptionsBuilder

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

Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:103

Fluent builder for ShardCoordinatorOptionsType. Consumed by ClusterSharding when it spawns the per-type coordinator; the cluster / localResolver wiring fields are supplied by the extension, the rest surface the user-tunable coordinator options.

The polymorphic fields — allocationStrategy (AllocationStrategy), lease (Lease), rememberEntitiesStore, coordinatorStateStore, and the cluster / localResolver wiring — are passed whole via a single withX(value).

new ShardCoordinatorOptionsBuilder(): ShardCoordinatorOptionsBuilder

ShardCoordinatorOptionsBuilder

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


withAcquireRetryIntervalMs(acquireRetryIntervalMs): this

Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:160

Retry interval for lease.acquire() after a failed attempt. Default: 5 s.

number

this


withAllocationStrategy(allocationStrategy): this

Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:120

Strategy used to allocate and rebalance shards across regions.

AllocationStrategy

this


withCluster(cluster): this

Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:115

The cluster this coordinator observes for leader/membership changes.

Cluster

this


withCoordinatorStateStore(coordinatorStateStore): this

Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:170

Persistence backend for the allocation state (regions + shardHome).

CoordinatorStateStore

this


withHandOffTimeoutMs(handOffTimeoutMs): this

Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:140

Time to wait for HandOffComplete before force-reallocating. Default: 10 s.

number

this


withLease(lease): this

Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:155

Optional split-brain protection — coordinator must hold the lease before acting.

Lease

this


withLocalResolver(localResolver): this

Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:150

Resolver for local actor paths — used when coordinator and region share a node.

(path) => ActorRef<unknown> | null

this


withNumShards(numShards): this

Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:125

Shard count for this entity type — the bound a GetShardHome must fall inside.

number

this


withRebalanceIntervalMs(rebalanceIntervalMs): this

Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:135

Gap between coordinator-driven rebalance passes. Default: 2 s.

number

this


withRememberEntities(rememberEntities?): this

Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:145

Track entity lifecycle so entities can be re-created on the new owner.

boolean = true

this


withRememberEntitiesStore(rememberEntitiesStore): this

Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:165

Persistence backend for the entity registry (only used when rememberEntities).

RememberEntitiesStore

this


withRole(role): this

Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:130

Only members carrying this role are candidates for hosting shards.

string

this


withTypeName(typeName): this

Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:110

Logical name of the sharded type this coordinator governs.

string

this


static create(): ShardCoordinatorOptionsBuilder

Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:105

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

ShardCoordinatorOptionsBuilder