loadwise-core 0.1.0

Core traits, strategies, and in-memory stores for loadwise
Documentation
//! 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]);
//! ```

pub mod filter;
pub mod health;
pub mod metrics;
pub mod node;
pub mod quota;
pub mod state;
pub mod strategy;
pub(crate) mod window;

pub use filter::{Filter, HealthAware, HealthFilter, QuotaFilter};
pub use health::{ConsecutiveFailurePolicy, HealthPolicy, HealthStatus, HealthTracker, NodeHealth, Outcome};
pub use metrics::{MetricsCollector, NoopCollector};
pub use node::{LoadMetric, Node, RateMetric, Weighted};
pub use quota::{QuotaConfig, QuotaDimension, QuotaTracker};
pub use state::{InMemoryStore, StateStore};
pub use strategy::{SelectionContext, Strategy};