globalElection

inline fun <ID : Any, Strength : Comparable<Strength>> Aggregate<ID>.globalElection(strength: Strength, metric: Field<ID, Int> = hops(), crossinline selectBest: Reducer<Candidacy<ID, Int, Strength>> = ::maxOf): ID

Self-stabilizing, priority-based single-leader election built by forcing Int.MAX_VALUE as bound for boundedElection.

strength defines the priority of the candidate. metric is a field that defines the distance between devices. Provided two candidates, selectBest selects the best Candidacy, defaulting to maxOf


inline fun <ID : Comparable<ID>> Aggregate<ID>.globalElection(): ID

Self-stabilizing, priority-based single-leader election built by forcing Int.MAX_VALUE as bound for boundedElection.

This version uses the local ID as strength.