public class FailurePolicy<T> extends Object
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.rxjava3.circuitbreaker.FailurePolicy<T>)
.
original
non RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<FailurePolicy> |
__TYPE_ARG |
io.vertx.lang.rx.TypeArg<T> |
__typeArg_0 |
Constructor and Description |
---|
FailurePolicy(FailurePolicy delegate) |
FailurePolicy(Object delegate,
io.vertx.lang.rx.TypeArg<T> typeArg_0) |
Modifier and Type | Method and Description |
---|---|
static <U> FailurePolicy<U> |
defaultPolicy()
The default policy, which considers an asynchronous result as a failure if returns
true . |
boolean |
equals(Object o) |
FailurePolicy |
getDelegate() |
int |
hashCode() |
static <T> FailurePolicy<T> |
newInstance(FailurePolicy arg) |
static <T> FailurePolicy<T> |
newInstance(FailurePolicy arg,
io.vertx.lang.rx.TypeArg<T> __typeArg_T) |
boolean |
test(Single<T> future)
Invoked by the
CircuitBreaker when an operation completes. |
String |
toString() |
public static final io.vertx.lang.rx.TypeArg<FailurePolicy> __TYPE_ARG
public final io.vertx.lang.rx.TypeArg<T> __typeArg_0
public FailurePolicy(FailurePolicy delegate)
public FailurePolicy getDelegate()
public static <U> FailurePolicy<U> defaultPolicy()
true
.public boolean test(Single<T> future)
CircuitBreaker
when an operation completes.future
- a completed futuretrue
if the asynchronous result should be considered as a failure, false
otherwisepublic static <T> FailurePolicy<T> newInstance(FailurePolicy arg)
public static <T> FailurePolicy<T> newInstance(FailurePolicy arg, io.vertx.lang.rx.TypeArg<T> __typeArg_T)
Copyright © 2024 Eclipse. All rights reserved.