Class FailurePolicy<T>


  • public class FailurePolicy<T>
    extends Object
    A failure policy for the CircuitBreaker.

    The default policy is to consider an asynchronous result as a failure if returns true. Nevertheless, sometimes this is not good enough. For example, an HTTP Client could return a response, but with an unexpected status code.

    In this case, a custom failure policy can be configured with CircuitBreaker.failurePolicy(io.vertx.reactivex.circuitbreaker.FailurePolicy<T>).

    NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.

    • Constructor Detail

      • FailurePolicy

        public FailurePolicy​(FailurePolicy delegate)
      • FailurePolicy

        public FailurePolicy​(Object delegate,
                             TypeArg<T> typeArg_0)
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • defaultPolicy

        public static <U> FailurePolicy<U> defaultPolicy()
        The default policy, which considers an asynchronous result as a failure if returns true.
        Returns:
      • test

        public boolean test​(Future<T> future)
        Invoked by the CircuitBreaker when an operation completes.
        Parameters:
        future - a completed future
        Returns:
        true if the asynchronous result should be considered as a failure, false otherwise
      • test

        public boolean test​(io.reactivex.Single<T> future)
        Invoked by the CircuitBreaker when an operation completes.
        Parameters:
        future - a completed future
        Returns:
        true if the asynchronous result should be considered as a failure, false otherwise