// Adjusting upscaling in according to the upper_bound limits.
Adjusting upscaling in according to the upper_bound limits.
Adjusting upscaling in according to the upper_bound limits .
fn adjustment_upscaling(
        &self,
        actors: &FxHashMap<BastionId, (Sender, RecoverableHandle<()>)>,
        desired_upscale: u64,
    ) -> ScalingRule {
        match self.upper_bound {
            UpperBound::Limit(actors_limit) => {
                let active_actors = actors.len() as u64;
                let can_be_added_actors_max = actors_limit - active_actors;
                let added_actors_limit = min(desired_upscale, can_be_added_actors_max);
                match added_actors_limit {
                    0 => ScalingRule::DoNothing,
                    _ => ScalingRule::Upscale(added_actors_limit),
                }
            }
            UpperBound::Unlimited => ScalingRule::Upscale(desired_upscale),
        }
    }
fn adjustment_upscaling ( & self , actors : & FxHashMap < BastionId , ( Sender , RecoverableHandle < ( ) > ) > , desired_upscale : u64 , ) -> ScalingRule { match self . upper_bound { UpperBound :: Limit ( actors_limit ) => { let active_actors = actors . len ( ) as u64 ; let can_be_added_actors_max = actors_limit - active_actors ; let added_actors_limit = min ( desired_upscale , can_be_added_actors_max ) ; match added_actors_limit { 0 => ScalingRule :: DoNothing , _ => ScalingRule :: Upscale ( added_actors_limit ) , } } UpperBound :: Unlimited => ScalingRule :: Upscale ( desired_upscale ) , } }
Adjusting upscaling in according to the upper_bound limits.
Adjusting upscaling in according to the upper_bound limits .
&self
actors
&FxHashMap<BastionId, (Sender, RecoverableHandle<()>)>
desired_upscale
u64