Package com.couchbase.client.core.retry
Class BestEffortRetryStrategy
- java.lang.Object
-
- com.couchbase.client.core.retry.BestEffortRetryStrategy
-
- All Implemented Interfaces:
RetryStrategy
public class BestEffortRetryStrategy extends Object implements RetryStrategy
-
-
Field Summary
Fields Modifier and Type Field Description static BestEffortRetryStrategy
INSTANCE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<RetryAction>
shouldRetry(Request<? extends Response> request, RetryReason reason)
Checks if the given request should be retried and how long the retry delay should be.String
toString()
static BestEffortRetryStrategy
withExponentialBackoff(Duration lower, Duration upper, int factor)
-
-
-
Field Detail
-
INSTANCE
public static final BestEffortRetryStrategy INSTANCE
-
-
Method Detail
-
withExponentialBackoff
public static BestEffortRetryStrategy withExponentialBackoff(Duration lower, Duration upper, int factor)
-
shouldRetry
public CompletableFuture<RetryAction> shouldRetry(Request<? extends Response> request, RetryReason reason)
Description copied from interface:RetryStrategy
Checks if the given request should be retried and how long the retry delay should be.- Specified by:
shouldRetry
in interfaceRetryStrategy
- Parameters:
request
- the request to be checked.- Returns:
- If empty, no retry should be done. If a duration is returned it determines the retry delay.
-
-