pub struct LoadBalancer { /* private fields */ }Expand description
Load balancer for shard distribution
Implementations§
Source§impl LoadBalancer
impl LoadBalancer
Sourcepub fn update_load(&self, shard_id: u32, load: f64)
pub fn update_load(&self, shard_id: u32, load: f64)
Update load for a shard
Sourcepub fn get_least_loaded_shard(&self, shard_ids: &[u32]) -> Option<u32>
pub fn get_least_loaded_shard(&self, shard_ids: &[u32]) -> Option<u32>
Get the least loaded shard
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LoadBalancer
impl !RefUnwindSafe for LoadBalancer
impl Send for LoadBalancer
impl Sync for LoadBalancer
impl Unpin for LoadBalancer
impl !UnwindSafe for LoadBalancer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more