Skip to content

blazood/concurrent-round-robin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

concurrent-round-robin

A concurrent wrr implementation for rust

quick start

[dependencies]
concurrent-round-robin="0.1"
use concurrent_round_robin::WeightedRoundRobinSelector;

fn main() {
    let balancer = Arc::new(WeightedRoundRobinSelector::new(
        vec![("1", 1), ("2", 2)]
    ));
    for _i in 0..100 {
        let arc = balancer.clone();
        std::thread::spawn(move || {
            println!("{}", arc.select().unwrap().value());
        });
    }
}

About

concurrent wrr implementation for rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages