@web/circuit-breaker
v1.0.0
MIT
.cap
✓ Verified by capdux.org
AI-First .d.cp
Official Envoy / Tower three-state circuit breaker (Closed / Open / HalfOpen) plugin for cap:web
Install with Cap
$ cap add @web/circuit-breaker
AI Interface Stub .d.cp
// Type definitions for CP
import { App, AppMethod, Context, Response, Plugin, PluginScope } from "../../../../lib/web/app.cp";
export enum CircuitState {
Closed,
Open,
HalfOpen
}
export class CircuitBreakerConfig {
failure_threshold: u32,
reset_timeout_secs: u64,
retry_after_secs: string,
}
export fn cbNowSec(): u64;
export fn cbState(): CircuitState;
export fn cbFailureCount(): u32;
export fn cbSetTestClock(now_sec: u64);
export fn cbReset();
export fn cbBeforeHandle(ctx: &mut Context): bool;
export fn cbAfterHandle(ctx: &mut Context, resp: &mut Response);
export fn cbCreatePlugin(cfg: CircuitBreakerConfig): Plugin;
export fn registerCircuitBreaker(app: &mut App, cfg: CircuitBreakerConfig): &mut App;
README
MarkdownNo README provided for this package version.
Version History
1 release| Version | Format / Size | Integrity (SHA-256) | Downloads | Published | Status |
|---|---|---|---|---|---|
| v1.0.0 | .cap · 2.6 KB | sha256-9d6470a9e8da1e6e… | 0 | 2026-11-26 | latest |