loadwise 0.1.0

A protocol-agnostic load balancing strategy engine for Rust
Documentation
//! 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 loadwise_core::*;

#[cfg(feature = "tower")]
pub mod tower {
    pub use loadwise_tower::*;
}

#[cfg(feature = "redis")]
pub mod redis {
    pub use loadwise_store_redis::*;
}