Agent Maturity Compass API - v1.2.0
Guides
HTTP API
GitHub
Preparing search index...
index
withCircuitBreaker
Function withCircuitBreaker
withCircuitBreaker
<
T
>
(
circuitName
:
string
,
fn
:
()
=>
Promise
<
T
>
,
options
?:
{
timeoutMs
?:
number
}
,
)
:
Promise
<
T
>
Execute a function with circuit breaker protection.
If circuit is CLOSED: execute normally, track success/failure
If circuit is OPEN: reject immediately (unless recovery window elapsed → HALF_OPEN)
If circuit is HALF_OPEN: allow limited attempts, close on success, reopen on failure
All executions are time-bounded by per-hook or global timeout
Type Parameters
T
Parameters
circuitName
:
string
fn
:
()
=>
Promise
<
T
>
Optional
options
:
{
timeoutMs
?:
number
}
Returns
Promise
<
T
>
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
Guides
HTTP API
GitHub
Agent Maturity Compass API - v1.2.0
Loading...
Execute a function with circuit breaker protection.