Class ErrorRecoveryManager.CircuitBreaker

java.lang.Object
com.lucimber.dbus.util.ErrorRecoveryManager.CircuitBreaker
Enclosing class:
ErrorRecoveryManager

public static class ErrorRecoveryManager.CircuitBreaker extends Object
Circuit breaker implementation for preventing cascading failures.
  • Method Details

    • execute

      public <T> CompletableFuture<T> execute(Supplier<CompletableFuture<T>> operation)
      Executes an operation through the circuit breaker.
      Type Parameters:
      T - the result type
      Parameters:
      operation - the operation to execute
      Returns:
      CompletableFuture that completes with the operation result
    • getState

      Gets the current state of the circuit breaker.
    • getFailureCount

      public int getFailureCount()
      Gets the current failure count.
    • reset

      public void reset()
      Resets the circuit breaker to CLOSED state.