Class CircuitBreakerBuilder
java.lang.Object
io.vertx.rxjava3.circuitbreaker.CircuitBreakerBuilder
- All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate
A builder for
CircuitBreaker.
Unlike CircuitBreaker.openHandler(Handler), CircuitBreaker.halfOpenHandler(Handler) and
CircuitBreaker.closeHandler(Handler), the handlers configured through this builder are baked in as
immutable when build() is called: calling the corresponding mutator method again on the built circuit
breaker throws an IllegalStateException.
NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCircuitBreakerBuilder(CircuitBreakerBuilder delegate) CircuitBreakerBuilder(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build and return the circuit breaker.closeHandler(Handler<Void> handler) Set the handler invoked when the circuit breaker state switches to closed.booleanfailurePolicy(FailurePolicy<T> failurePolicy) Set the failure policy, seeCircuitBreaker.failurePolicy(FailurePolicy).Set the default fallback function, seeCircuitBreaker.fallback(Function).halfOpenHandler(Handler<Void> handler) Set the handler invoked when the circuit breaker state switches to half-open.inthashCode()static CircuitBreakerBuilderopenHandler(Handler<Void> handler) Set the handler invoked when the circuit breaker state switches to open.retryPolicy(RetryPolicy retryPolicy) Set the retry policy, seeCircuitBreaker.retryPolicy(RetryPolicy).toString()with(CircuitBreakerOptions options) Configure the circuit breaker options.
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
CircuitBreakerBuilder
-
CircuitBreakerBuilder
-
-
Method Details
-
toString
-
equals
-
hashCode
-
getDelegate
- Specified by:
getDelegatein interfaceio.vertx.lang.rx.RxDelegate
-
with
Configure the circuit breaker options.- Parameters:
options- the configuration options- Returns:
- a reference to this, so the API can be used fluently
-
openHandler
Set the handler invoked when the circuit breaker state switches to open.- Parameters:
handler- the handler- Returns:
- a reference to this, so the API can be used fluently
-
halfOpenHandler
Set the handler invoked when the circuit breaker state switches to half-open.- Parameters:
handler- the handler- Returns:
- a reference to this, so the API can be used fluently
-
closeHandler
Set the handler invoked when the circuit breaker state switches to closed.- Parameters:
handler- the handler- Returns:
- a reference to this, so the API can be used fluently
-
fallback
Set the default fallback function, seeCircuitBreaker.fallback(Function).- Parameters:
handler- the fallback function- Returns:
- a reference to this, so the API can be used fluently
-
failurePolicy
Set the failure policy, seeCircuitBreaker.failurePolicy(FailurePolicy).- Parameters:
failurePolicy- the failure policy- Returns:
- a reference to this, so the API can be used fluently
-
retryPolicy
Set the retry policy, seeCircuitBreaker.retryPolicy(RetryPolicy).- Parameters:
retryPolicy- the retry policy- Returns:
- a reference to this, so the API can be used fluently
-
build
Build and return the circuit breaker.- Returns:
- the circuit breaker as configured by this builder
-
newInstance
-