atomic-circuit-breaker 11.2.0

Zero-dependency, lock-free atomic sliding-window circuit breaker with CAS probe gating, monotonic clock support, and RAII guards.
Documentation
  • Coverage
  • 100%
    31 out of 31 items documented0 out of 0 items with examples
  • Size
  • Source code size: 117.5 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 914.0 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates-dev/ctares
    2 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • vshengbro

atomic-circuit-breaker

Zero-Dependency Lock-Free Atomic Sliding-Window Circuit Breaker

Crates.io Version Docs.rs CI Status Rust 2024 License: MIT

Workspace Overview · API Docs


Overview

atomic-circuit-breaker implements a zero-dependency, lock-free atomic sliding-window circuit breaker with Closed/Open/HalfOpen transitions, CAS probe gating, monotonic clock support, and RAII permit guards.

Installation

cargo add atomic-circuit-breaker

Usage

use atomic_circuit_breaker::{CircuitBreaker, CircuitBreakerConfig};

let config = CircuitBreakerConfig::new()
    .with_consecutive_failure_threshold(Some(5))
    .with_failure_rate_bps(Some(5000))
    .with_minimum_calls(20);
let breaker = CircuitBreaker::new(config).unwrap();

if breaker.allow() {
    breaker.record_success();
}

Verification

cargo run -p crate-cli -- fmt --check
cargo clippy -p atomic-circuit-breaker --all-features --all-targets -- -D warnings
cargo test -p atomic-circuit-breaker --all-features

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For inquiries, please contact the author at root@devhub.vip.