public interface RetryableResult<T>
OperationRetryer
. Three cases we have are:
Modifier and Type | Interface and Description |
---|---|
static class |
RetryableResult.Failure<T>
An instance of this Class is returned by
RetryableOperation to indicate
that the operation should no longer be retried. |
static class |
RetryableResult.Incomplete<T>
An instance of this Class is returned by
RetryableOperation to indicate
that the operation should be retried. |
static class |
RetryableResult.Success<T>
An instance of this Class is returned by
RetryableOperation to indicate
successful completion of a RetryableOperation . |
Modifier and Type | Method and Description |
---|---|
T |
get()
Return the result of the retriable operation if the operation succeeds.
|
boolean |
shouldRetry()
Returns a boolean indicating if the operation should be retried.
|
boolean |
shouldStop()
Returns a boolean indicating that the
OperationRetryer should
no longer retry the operation and return null as a result of
the operation. |
T get()
boolean shouldRetry()
OperationRetryer
may still decide to not retry this operation, for
example if the number of retries have reached or timeout has expired.boolean shouldStop()
OperationRetryer
should
no longer retry the operation and return null
as a result of
the operation.