StartSingletonOptionsType
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
StartSingletonOptionsType<
T> =object
Defined in: src/cluster/singleton/StartSingletonOptions.ts:16
Plain options-object shape accepted by ClusterSingleton.start.
Type Parameters
Section titled “Type Parameters”T
Properties
Section titled “Properties”acquireRetryIntervalMs?
Section titled “acquireRetryIntervalMs?”
readonlyoptionalacquireRetryIntervalMs?: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.
readonlyactor:ActorClassOrFactory<T>
Defined in: src/cluster/singleton/StartSingletonOptions.ts:20
The singleton actor — its class, or a factory when it needs dependencies.
actorOptions?
Section titled “actorOptions?”
readonlyoptionalactorOptions?:ActorOptions<T>
Defined in: src/cluster/singleton/StartSingletonOptions.ts:22
Spawn options for the singleton instance.
bufferSize?
Section titled “bufferSize?”
readonlyoptionalbufferSize?: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.
lease?
Section titled “lease?”
readonlyoptionallease?: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.
readonlyoptionalrole?:string
Defined in: src/cluster/singleton/StartSingletonOptions.ts:24
If set, only nodes carrying this role tag will host the singleton.
typeName
Section titled “typeName”
readonlytypeName:string
Defined in: src/cluster/singleton/StartSingletonOptions.ts:18
Logical name for this singleton — used in the manager/child actor path.
