Skip to main content

select_least_loaded

Function select_least_loaded 

Source
pub fn select_least_loaded(candidates: &[SubscriberLoad]) -> Option<usize>
Expand description

Choose the subscriber that receives the next unassigned partition of a topic in UniformHeterogeneousAssignmentBuilder.assignRemainingPartitions.

The host passes the topic’s subscribers in ascending member order. The result is None exactly for an empty slice. Otherwise no candidate precedes the chosen one, and the chosen one strictly precedes every earlier candidate, so the first of the least-loaded candidates wins.