Skip to content

LeaderLock

Defined in: packages/sharding/src/leader.ts:6

Leadership between several coordinators, so a standby ClusterManager can take over when the active one dies. Only the holder of the lock runs clusters; see ClusterManagerOptions.leader.

acquire(ttlMs): Promise<boolean>

Defined in: packages/sharding/src/leader.ts:12

Takes the lock for ttlMs, or extends it when this process already holds it. Resolves true while this process is the leader, false when another one holds it. A rejection counts as “unknown”.

number

Promise<boolean>


release(): Promise<void>

Defined in: packages/sharding/src/leader.ts:14

Gives the lock up if this process holds it.

Promise<void>