Skip to main content

LoadBalancer

Trait LoadBalancer 

Source
pub trait LoadBalancer: Send + Sync {
    // Required method
    fn select(&self, pool: &UpstreamPool, ctx: &LbContext) -> Option<usize>;
}
Expand description

Selects an upstream backend index from the pool.

Implementations must be Send + Sync so they can be shared across tasks.

Required Methods§

Source

fn select(&self, pool: &UpstreamPool, ctx: &LbContext) -> Option<usize>

Choose a backend index. Returns None when no backend is available.

Implementors§