Interface RetryStrategyWithContent<T extends Response>
-
- Type Parameters:
T
- the response type
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface RetryStrategyWithContent<T extends Response>
Determines whether a failed request should be retried using the content of aResponse
. If you just need the headers to make a decision, useRetryStrategy
for efficiency.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompletionStage<Backoff>
shouldRetry(ClientRequestContext ctx, T response)
Tells whether the request sent with the specifiedClientRequestContext
requires a retry or not.
-
-
-
Method Detail
-
shouldRetry
CompletionStage<Backoff> shouldRetry(ClientRequestContext ctx, T response)
Tells whether the request sent with the specifiedClientRequestContext
requires a retry or not. Implement this method to return aCompletionStage
and to complete it with a desiredBackoff
. To stop trying further, complete it withnull
.- Parameters:
ctx
- theClientRequestContext
of this requestresponse
- theResponse
from the server
-
-