public interface CircuitBreaker
| Modifier and Type | Method and Description |
|---|---|
static CircuitBreakerBuilder |
builder()
Returns a new
CircuitBreakerBuilder. |
static CircuitBreakerBuilder |
builder(String name)
Returns a new
CircuitBreakerBuilder that has the specified name. |
boolean |
canRequest()
Decides whether a request should be sent or failed depending on the current circuit state.
|
String |
name()
Returns the name of the circuit breaker.
|
static CircuitBreaker |
of(String name)
Creates a new
CircuitBreaker that has the specified name and the default configurations. |
static CircuitBreaker |
ofDefaultName()
Creates a new
CircuitBreaker that has a default name and the default configurations. |
void |
onFailure()
Reports a remote invocation failure.
|
void |
onSuccess()
Reports a remote invocation success.
|
static CircuitBreakerBuilder builder()
CircuitBreakerBuilder.static CircuitBreakerBuilder builder(String name)
CircuitBreakerBuilder that has the specified name.name - the name of the circuit breaker.static CircuitBreaker of(String name)
CircuitBreaker that has the specified name and the default configurations.name - the name of the circuit breakerstatic CircuitBreaker ofDefaultName()
CircuitBreaker that has a default name and the default configurations.String name()
void onSuccess()
void onFailure()
boolean canRequest()
Copyright © 2020 LeanCloud. All rights reserved.