コンテンツにスキップ
日本語

StartSingletonOptionsType

このコンテンツはまだ日本語訳がありません。

StartSingletonOptionsType<T> = object

Defined in: src/cluster/singleton/StartSingletonOptions.ts:16

Plain options-object shape accepted by ClusterSingleton.start.

T

readonly optional acquireRetryIntervalMs?: number

Defined in: src/cluster/singleton/StartSingletonOptions.ts:43

How often to retry lease.acquire() after a failed attempt (another holder owns it, transient backend error, etc.). Default: 5_000 ms. Ignored if no lease is provided.


readonly actor: ActorClassOrFactory<T>

Defined in: src/cluster/singleton/StartSingletonOptions.ts:20

The singleton actor — its class, or a factory when it needs dependencies.


readonly optional actorOptions?: ActorOptions<T>

Defined in: src/cluster/singleton/StartSingletonOptions.ts:22

Spawn options for the singleton instance.


readonly optional bufferSize?: number

Defined in: src/cluster/singleton/StartSingletonOptions.ts:55

How many messages the proxy holds while the cluster has no host for this singleton, before it starts dropping them to dead letters. Default: 1_000.

The wait is normally momentary — a leader is elected within a gossip round — but it is not bounded by anything: seeds unreachable, or a partition in which this node sees nobody, is a state that can last as long as the outage while the application keeps sending. A cap turns that from unbounded memory growth into visible message loss.


readonly optional lease?: Lease

Defined in: src/cluster/singleton/StartSingletonOptions.ts:37

Optional split-brain protection. When provided, the elected leader’s manager calls lease.acquire() before spawning the singleton — so a partition that produces two oldest views still only ever spawns the singleton on the side that holds the lease. The manager subscribes to lease.onLost(reason) and stops the child if ownership is revoked mid-flight.

Without a lease the manager keeps its current sync behaviour: spawn the moment cluster gossip says we’re leader, no external arbitration.


readonly optional role?: string

Defined in: src/cluster/singleton/StartSingletonOptions.ts:24

If set, only nodes carrying this role tag will host the singleton.


readonly typeName: string

Defined in: src/cluster/singleton/StartSingletonOptions.ts:18

Logical name for this singleton — used in the manager/child actor path.