loadwise-core 0.1.0

Core traits, strategies, and in-memory stores for loadwise
Documentation
  • Coverage
  • 96.58%
    141 out of 146 items documented12 out of 71 items with examples
  • Size
  • Source code size: 88.3 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 11.38 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 1m 2s Average build duration of successful builds.
  • all releases: 1m 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • arcboxlabs/loadwise
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • AprilNEA

Core traits, built-in strategies, and in-memory stores for the loadwise load balancing engine.

This crate is protocol-agnostic — it answers one question: "given these nodes and their current state, which one should handle the next request?"

Quick start

# extern crate loadwise_core as loadwise;
use loadwise::{Strategy, strategy::RoundRobin, SelectionContext};

let strategy = RoundRobin::new();
let backends = ["10.0.0.1:8080", "10.0.0.2:8080", "10.0.0.3:8080"];
let ctx = SelectionContext::default();

let idx = strategy.select(&backends, &ctx).unwrap();
println!("route to {}", backends[idx]);