Package ai.vespa.feed.client
Class GracePeriodCircuitBreaker
- java.lang.Object
-
- ai.vespa.feed.client.GracePeriodCircuitBreaker
-
- All Implemented Interfaces:
FeedClient.CircuitBreaker
public class GracePeriodCircuitBreaker extends java.lang.Object implements 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
FeedClient.CircuitBreaker.State
-
-
Field Summary
-
Fields inherited from interface ai.vespa.feed.client.FeedClient.CircuitBreaker
FUSED
-
-
Constructor Summary
Constructors Constructor Description GracePeriodCircuitBreaker(java.time.Duration grace, java.time.Duration doom)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
failure(ai.vespa.feed.client.HttpResponse response)
Called by the client whenever an error HTTP response is received.void
failure(java.lang.Throwable cause)
Called by the client whenever an exception occurs trying to obtain a HTTP response.FeedClient.CircuitBreaker.State
state()
The current state of the circuit breaker.void
success()
Called by the client whenever a successful response is obtained.
-
-
-
Method Detail
-
success
public void success()
Description copied from interface:FeedClient.CircuitBreaker
Called by the client whenever a successful response is obtained.- Specified by:
success
in interfaceFeedClient.CircuitBreaker
-
failure
public void failure(ai.vespa.feed.client.HttpResponse response)
Description copied from interface:FeedClient.CircuitBreaker
Called by the client whenever an error HTTP response is received.- Specified by:
failure
in interfaceFeedClient.CircuitBreaker
-
failure
public void failure(java.lang.Throwable cause)
Description copied from interface:FeedClient.CircuitBreaker
Called by the client whenever an exception occurs trying to obtain a HTTP response.- Specified by:
failure
in interfaceFeedClient.CircuitBreaker
-
state
public FeedClient.CircuitBreaker.State state()
Description copied from interface:FeedClient.CircuitBreaker
The current state of the circuit breaker.- Specified by:
state
in interfaceFeedClient.CircuitBreaker
-
-