Class Retry.DelayingRetryPolicy.Builder
java.lang.Object
io.helidon.faulttolerance.Retry.DelayingRetryPolicy.Builder
- All Implemented Interfaces:
Builder<Retry.DelayingRetryPolicy.Builder, Retry.DelayingRetryPolicy>, Supplier<Retry.DelayingRetryPolicy>
- Enclosing class:
Retry.DelayingRetryPolicy
public static class Retry.DelayingRetryPolicy.Builder
extends Object
implements Builder<Retry.DelayingRetryPolicy.Builder, Retry.DelayingRetryPolicy>
Fluent API builder for
Retry.DelayingRetryPolicy.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the instance from this builder.calls(int calls) Total number of calls (first + retries).Base delay between the invocations.delayFactor(double delayFactor) A delay multiplication factor.Random part of the delay.jitterFactor(double jitterFactor) Random jitter relative to the calculated delay, from0(inclusive) to1(exclusive).Maximum delay between invocation attempts, including jitter.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Builder
get, identity, updateModifier and TypeMethodDescriptiondefault Retry.DelayingRetryPolicyget()identity()Instance of this builder as the correct type.update(Consumer<Retry.DelayingRetryPolicy.Builder> consumer) Update the builder in a fluent API way.
-
Method Details
-
build
Description copied from interface:BuilderBuild the instance from this builder.- Specified by:
buildin interfaceBuilder<Retry.DelayingRetryPolicy.Builder, Retry.DelayingRetryPolicy>- Returns:
- instance of the built type
-
calls
Total number of calls (first + retries).- Parameters:
calls- how many times to call the method- Returns:
- updated builder instance
-
delay
Base delay between the invocations.- Parameters:
delay- delay between the invocations- Returns:
- updated builder instance
-
delayFactor
A delay multiplication factor.- Parameters:
delayFactor- a delay multiplication factor- Returns:
- updated builder instance
-
jitter
Random part of the delay. A number between[-jitter,+jitter]is applied after the delay factor is calculated.- Parameters:
jitter- jitter duration- Returns:
- updated builder instance
-
jitterFactor
Random jitter relative to the calculated delay, from0(inclusive) to1(exclusive). For example, a value of0.2applies a random jitter of up to twenty percent in either direction. Relative and absolute jitter cannot both be greater than zero.- Parameters:
jitterFactor- relative jitter factor- Returns:
- updated builder instance
-
maxDelay
Maximum delay between invocation attempts, including jitter. Jitter is applied first and the final non-negative delay is then capped by this value.- Parameters:
maxDelay- maximum delay- Returns:
- updated builder instance
-