Package com.couchbase.client.core.retry
Class FailFastRetryStrategy
java.lang.Object
com.couchbase.client.core.retry.FailFastRetryStrategy
- All Implemented Interfaces:
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
-
Method Summary
Modifier and TypeMethodDescriptionshouldRetry
(Request<? extends Response> request, RetryReason reason) Checks if the given request should be retried and how long the retry delay should be.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
-