Package com.couchbase.client.core.retry
Class FailFastRetryStrategy
java.lang.Object
com.couchbase.client.core.retry.FailFastRetryStrategy
- All Implemented Interfaces:
RetryStrategy
@Internal public class FailFastRetryStrategy extends Object implements RetryStrategy
An internal strategy to fail fast any request that goes through it.
This class is considered internal! For external purposes we recommend extending the BestEffortRetryStrategy
and only failing on certain RetryReason
as needed or based on a request context or external property. Using
this strategy here directly, if not used carefully, will lead to lot of copy/pasting of try/catch blocks and not
to clean code.
-
Field Summary
Fields Modifier and Type Field Description static FailFastRetryStrategy
INSTANCE
-
Method Summary
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()
-
Field Details
-
INSTANCE
-
-
Method Details
-
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.
-
toString
-