CircuitBreakerOptionsBuilder
이 콘텐츠는 아직 번역되지 않았습니다.
Defined in: src/pattern/CircuitBreakerOptions.ts:23
Fluent builder for CircuitBreakerOptionsType:
new CircuitBreaker(CircuitBreakerOptions.create() .withMaxFailures(5) .withResetTimeoutMs(10_000));Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CircuitBreakerOptionsBuilder():
CircuitBreakerOptionsBuilder
Returns
Section titled “Returns”CircuitBreakerOptionsBuilder
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”build()
Section titled “build()”build():
Partial<T>
Defined in: src/util/OptionsBuilder.ts:51
Snapshot the set fields as an independent Partial<T> (own props only).
Returns
Section titled “Returns”Partial<T>
Inherited from
Section titled “Inherited from”withCallTimeoutMs()
Section titled “withCallTimeoutMs()”withCallTimeoutMs(
callTimeoutMs):this
Defined in: src/pattern/CircuitBreakerOptions.ts:40
Per-call timeout; exceeding it counts as a failure.
Parameters
Section titled “Parameters”callTimeoutMs
Section titled “callTimeoutMs”number
Returns
Section titled “Returns”this
withIsFailure()
Section titled “withIsFailure()”withIsFailure(
isFailure):this
Defined in: src/pattern/CircuitBreakerOptions.ts:45
Classify errors as non-failures to bypass breaker counting.
Parameters
Section titled “Parameters”isFailure
Section titled “isFailure”(err) => boolean
Returns
Section titled “Returns”this
withMaxFailures()
Section titled “withMaxFailures()”withMaxFailures(
maxFailures):this
Defined in: src/pattern/CircuitBreakerOptions.ts:30
Consecutive failures before the breaker opens. Must be >= 1.
Parameters
Section titled “Parameters”maxFailures
Section titled “maxFailures”number
Returns
Section titled “Returns”this
withResetTimeoutMs()
Section titled “withResetTimeoutMs()”withResetTimeoutMs(
resetTimeoutMs):this
Defined in: src/pattern/CircuitBreakerOptions.ts:35
How long the breaker stays open before letting a probe through (ms).
Parameters
Section titled “Parameters”resetTimeoutMs
Section titled “resetTimeoutMs”number
Returns
Section titled “Returns”this
create()
Section titled “create()”
staticcreate():CircuitBreakerOptionsBuilder
Defined in: src/pattern/CircuitBreakerOptions.ts:25
Start a fresh builder.
Returns
Section titled “Returns”CircuitBreakerOptionsBuilder
