Package ai.vespa.feed.client.impl
Class GracePeriodCircuitBreaker
java.lang.Object
ai.vespa.feed.client.impl.GracePeriodCircuitBreaker
- All Implemented Interfaces:
ai.vespa.feed.client.FeedClient.CircuitBreaker
public class GracePeriodCircuitBreaker
extends Object
implements ai.vespa.feed.client.FeedClient.CircuitBreaker
Breaks the circuit when no successes have been recorded for a specified time.
- Author:
- jonmv
-
Nested Class Summary
Nested classes/interfaces inherited from interface ai.vespa.feed.client.FeedClient.CircuitBreaker
ai.vespa.feed.client.FeedClient.CircuitBreaker.State
-
Field Summary
Fields inherited from interface ai.vespa.feed.client.FeedClient.CircuitBreaker
FUSED
-
Constructor Summary
ConstructorDescriptionCreates a new circuit breaker with the given grace periods.GracePeriodCircuitBreaker
(Duration grace, Duration doom) Creates a new circuit breaker with the given grace periods. -
Method Summary
-
Constructor Details
-
GracePeriodCircuitBreaker
Creates a new circuit breaker with the given grace periods.- Parameters:
grace
- the period of consecutive failures before state changes to half-open.
-
GracePeriodCircuitBreaker
Creates a new circuit breaker with the given grace periods.- Parameters:
grace
- the period of consecutive failures before state changes to half-open.doom
- the period of consecutive failures before shutting down.
-
-
Method Details
-
success
public void success()- Specified by:
success
in interfaceai.vespa.feed.client.FeedClient.CircuitBreaker
-
failure
public void failure(ai.vespa.feed.client.HttpResponse response) - Specified by:
failure
in interfaceai.vespa.feed.client.FeedClient.CircuitBreaker
-
failure
- Specified by:
failure
in interfaceai.vespa.feed.client.FeedClient.CircuitBreaker
-
state
public ai.vespa.feed.client.FeedClient.CircuitBreaker.State state()- Specified by:
state
in interfaceai.vespa.feed.client.FeedClient.CircuitBreaker
-