java.lang.Object
io.helidon.faulttolerance.Retry.FibonacciRetryPolicy
- All Implemented Interfaces:
Retry.RetryPolicy
- Enclosing interface:
- Retry
A retry policy that increases the delay time following the Fibonacci sequence.
Allowed elements that are also annotated with
@Retry.
Expected sequence: initial delay, 2 * initial delay + jitter, 3 * initial delay + jitter,
5 * initial delay + jitter, etc. maxDelayInMillis is used to prevent endless waiting.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()A new fluent API builder to configure instances ofRetry.nextDelayMillis(long firstCallMillis, long lastDelay, int call) Return next delay in milliseconds, or an empty optional to finish retries.
-
Method Details
-
builder
A new fluent API builder to configure instances ofRetry.- Returns:
- a new builder
-
nextDelayMillis
Description copied from interface:Retry.RetryPolicyReturn next delay in milliseconds, or an empty optional to finish retries.- Specified by:
nextDelayMillisin interfaceRetry.RetryPolicy- Parameters:
firstCallMillis- milliseconds recorded before the first call usingSystem.currentTimeMillis()lastDelay- last delay that was used (0 for the first failed call)call- call index (0 for the first failed call)- Returns:
- how long to wait before trying again, or empty to notify this is the end of retries
-