public final class CircuitBreakerCallAdapter
extends retrofit2.CallAdapter.Factory
CallAdapter.Factory that decorates a Call to provide integration with
a CircuitBreaker| Modifier and Type | Method and Description |
|---|---|
retrofit2.CallAdapter<?,?> |
get(java.lang.reflect.Type returnType,
java.lang.annotation.Annotation[] annotations,
retrofit2.Retrofit retrofit) |
static CircuitBreakerCallAdapter |
of(io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker)
Create a circuit-breaking call adapter that decorates retrofit calls
|
static CircuitBreakerCallAdapter |
of(io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker,
java.util.function.Predicate<retrofit2.Response> successResponse)
Create a circuit-breaking call adapter that decorates retrofit calls
|
public static CircuitBreakerCallAdapter of(io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker)
circuitBreaker - circuit breaker to useCallAdapter.Factory that can be passed into the Retrofit.Builderpublic static CircuitBreakerCallAdapter of(io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker, java.util.function.Predicate<retrofit2.Response> successResponse)
circuitBreaker - circuit breaker to usesuccessResponse - Predicate that determines whether the Call Response should be considered successfulCallAdapter.Factory that can be passed into the Retrofit.Builderpublic retrofit2.CallAdapter<?,?> get(java.lang.reflect.Type returnType,
java.lang.annotation.Annotation[] annotations,
retrofit2.Retrofit retrofit)
get in class retrofit2.CallAdapter.Factory