Skip to main content

rs_zero/resil/
mod.rs

1//! Minimal resilience primitives for rs-zero.
2
3pub mod breaker;
4mod breaker_state;
5pub mod concurrency;
6pub mod cpu;
7#[cfg(feature = "cache-redis")]
8pub mod period_limiter;
9pub mod registry;
10pub mod shedder;
11mod shedder_state;
12pub mod timeout;
13#[cfg(feature = "cache-redis")]
14pub mod token_limiter;
15pub mod window;
16
17pub use breaker::{
18    BreakerCallError, BreakerConfig, BreakerError, BreakerGuard, BreakerPolicyConfig,
19    BreakerSnapshot, BreakerState, CircuitBreaker, SharedCircuitBreaker,
20};
21pub use concurrency::ConcurrencyLimit;
22pub use cpu::{
23    CpuSamplerConfig, CpuUsageProvider, LinuxCpuUsageProvider, NoopCpuUsageProvider,
24    SharedCpuUsageProvider, real_cpu_provider,
25};
26#[cfg(feature = "cache-redis")]
27pub use period_limiter::{PeriodAlignment, RedisPeriodLimiter, RedisPeriodLimiterConfig};
28pub use registry::{BreakerRegistry, ShedderRegistry};
29pub use shedder::{
30    AdaptiveShedder, AdaptiveShedderConfig, ShedderError, ShedderGuard, ShedderSnapshot,
31};
32pub use timeout::{TimeoutError, run_with_timeout};
33#[cfg(feature = "cache-redis")]
34pub use token_limiter::{RedisTokenLimiter, RedisTokenLimiterConfig, TokenLimiterRescueConfig};
35pub use window::{RollingWindow, WindowConfig, WindowOutcome, WindowSnapshot};
36
37#[cfg(test)]
38mod breaker_tests;