The ICircuitBreakerAdapter contract defines a way for managing circuit breakers independent of the underlying technology and algorithm.
This contract is not meant to be used directly, instead you should use ICircuitBreakerProvider contract.
The isolate method will transition the circuit breaker to isolated state, meaning the circuit breaker will reject all attempts untill it is manually reset.
Parameters
key: string
Returns Promise<void>
reset:function
reset(key:string):Promise<void>
The reset method resets circuit breaker to its initial state regardless of the current state.
Parameters
key: string
Returns Promise<void>
trackFailure:function
trackFailure(key:string):Promise<void>
The trackFailure will method will track failure metric that will be used in updateState method.
Parameters
key: string
Returns Promise<void>
trackSuccess:function
trackSuccess(key:string):Promise<void>
The trackSuccess will method will track success metric that will be used in updateState method.
The
ICircuitBreakerAdaptercontract defines a way for managing circuit breakers independent of the underlying technology and algorithm. This contract is not meant to be used directly, instead you should useICircuitBreakerProvidercontract.IMPORT_PATH:
"@daiso-tech/core/circuit-breaker/contracts"