Skip to main content

Interface: UseLeaderOptions

Deliberately extends CommonOptions, not BusOptions: heartbeatMs here means the leader's re-announce interval, which is a different thing from the bus's presence ping. See the note in leader.ts about forwarding to getBus.

Extends

Properties

eligible?

optional eligible?: boolean;

May this client hold the leadership? Default true.

Inherited from

LeaderOptions.eligible


heartbeatMs?

optional heartbeatMs?: number;

How often the leader re-announces itself, in ms. Default 1000.

Inherited from

LeaderOptions.heartbeatMs


kind?

optional kind?: PeerKind;

What this client announces itself as. Defaults to 'worker' when there is no document, else 'tab'.

Inherited from

LeaderOptions.kind


leaseMs?

optional leaseMs?: number;

How long a follower tolerates silence before calling the seat empty, in ms. Default 3000.

Inherited from

LeaderOptions.leaseMs


name?

optional name?: string;

Which bus to elect on. Defaults to the shared default name.


transport?

optional transport?: (name) => Transport;

Transport factory, mainly for tests. Defaults to defaultTransport.

Parameters

ParameterType
namestring

Returns

Transport

Inherited from

LeaderOptions.transport