import { DatabaseCircuitBreakerAdapter } from "@daiso-tech/core/circuit-breaker/database-circuit-breaker-adapter";
import { MemoryCircuitBreakerStorageAdapter } from "@daiso-tech/core/circuit-breaker/memory-circuit-breaker-storage-adapter";
const circuitBreakerStorageAdapter = new MemoryCircuitBreakerStorageAdapter();
const circuitBreakerAdapter = new DatabaseCircuitBreakerAdapter({
adapter: circuitBreakerStorageAdapter
});
The getState method returns the state of the circuit breaker. The circuit breaker can be closed, open, half open state and isolated state.
The updateState method updates the state of the circuit breaker and returns the state transition.
IMPORT_PATH:
"@daiso-tech/core/circuit-breaker/database-circuit-breaker-adapter"