awaitLeader

suspend fun awaitLeader(within: Duration = DEFAULT_AWAIT): RaftNode

Suspend until some node is RaftRole.Leader; return it, or fail fast with a state dump.


suspend fun awaitLeader(among: Set<NodeId>, within: Duration = DEFAULT_AWAIT): RaftNode

Suspend until a node whose id is in among is RaftRole.Leader. Use after a partition when a stale leader from the minority partition may transiently report leader status — scope the await to the surviving voters.