Bot); the bot
calls start when it starts and stop when it stops.
Properties
replicaId
Methods
start()
Returns
Promise<void>
stop()
Returns
Promise<void>
reserve()
key’s cross-replica FIFO. The bot calls it in ingress order.
Parameters
Returns
Promise<Ticket>
acquireTurn()
ticket’s turn (tickets of replicas that died are skipped), then
hold the key. Rejects with LeaseLostError ('superseded') when the ticket was
skipped because this replica was presumed dead, and with
CoordinationUnavailableError on timeout or backend failure.
Parameters
Returns
Promise<ChatTurn>
lead()
name until elected (or opts.signal aborts, rejecting).
Parameters
Returns
Promise<Leadership>
tryLead()
null when another replica leads.
Parameters
Returns
Promise<Leadership | null>
on()
Type Parameters
Parameters
Returns
() =>void