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.
Methods
Section titled “Methods”acquire()
Section titled “acquire()”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”.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”Promise<boolean>
release()
Section titled “release()”release():
Promise<void>
Defined in: packages/sharding/src/leader.ts:14
Gives the lock up if this process holds it.
Returns
Section titled “Returns”Promise<void>