1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! A protocol-agnostic load balancing strategy engine for Rust.
//!
//! `loadwise` is a facade crate that re-exports everything from
//! [`loadwise_core`] and optionally integrates with Tower and Redis
//! via feature flags.
//!
//! # Quick start
//!
//! ```
//! use loadwise::{Strategy, SelectionContext};
//! use loadwise::strategy::RoundRobin;
//!
//! 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]);
//! ```
//!
//! # Feature flags
//!
//! | Flag | Enables |
//! |---------|-------------------------------------------|
//! | `tower` | `tower` module — Tower Layer adapter |
//! | `redis` | `redis` module — Redis StateStore backend|
pub use *;