UNPKG

@daiso-tech/core

Version:

The library offers flexible, framework-agnostic solutions for modern web applications, built on adaptable components that integrate seamlessly with popular frameworks like Next Js.

43 lines 1.25 kB
/** * @module CircuitBreaker */ import {} from "../../circuit-breaker/contracts/circuit-breaker-state.contract.js"; /** * Enumerated state transitions when circuit breaker is in CLOSED state. * Determines whether to transition to OPEN or remain CLOSED. * * IMPORT_PATH: `"@daiso-tech/core/circuit-breaker/contracts"` * @group Contracts */ export const CLOSED_TRANSITIONS = { /** * Transition from CLOSED to OPEN state based on failure/slowness detection. */ TO_OPEN: "TO_OPEN", /** * Remain in CLOSED state; no transition needed. */ NONE: "NONE", }; /** * Enumerated state transitions when circuit breaker is in HALF_OPEN state. * Determines recovery (transition to CLOSED), continued failure (transition to OPEN), or hold (remain HALF_OPEN). * * IMPORT_PATH: `"@daiso-tech/core/circuit-breaker/contracts"` * @group Contracts */ export const HALF_OPEN_TRANSITIONS = { /** * Return to OPEN state if recovery failed. */ TO_OPEN: "TO_OPEN", /** * Transition to CLOSED state if recovery succeeded. */ TO_CLOSED: "TO_CLOSED", /** * Remain in HALF_OPEN state; continue testing. */ NONE: "NONE", }; //# sourceMappingURL=circuit-breaker-policy.contract.js.map