Class CircuitBreakerOperator<T>

java.lang.Object
io.github.resilience4j.reactor.circuitbreaker.operator.CircuitBreakerOperator<T>
Type Parameters:
T - the value type
All Implemented Interfaces:
Function<org.reactivestreams.Publisher<T>,org.reactivestreams.Publisher<T>>, UnaryOperator<org.reactivestreams.Publisher<T>>

public class CircuitBreakerOperator<T> extends Object implements UnaryOperator<org.reactivestreams.Publisher<T>>
A CircuitBreaker operator which checks if a downstream subscriber/observer can acquire a permission to subscribe to an upstream Publisher. Otherwise emits a CallNotPermittedException if the CircuitBreaker is OPEN.
  • Method Details

    • of

      public static <T> CircuitBreakerOperator<T> of(io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker)
      Creates a CircuitBreakerOperator.
      Type Parameters:
      T - the value type of the upstream and downstream
      Parameters:
      circuitBreaker - the circuit breaker
      Returns:
      a CircuitBreakerOperator
    • apply

      public org.reactivestreams.Publisher<T> apply(org.reactivestreams.Publisher<T> publisher)
      Specified by:
      apply in interface Function<org.reactivestreams.Publisher<T>,org.reactivestreams.Publisher<T>>