Interface Delay
-
- All Known Implementing Classes:
Blended,Constant,Exponential,MultipleOf,ShiftByMultipleOf
public interface DelayThis interface defines theDelaythat you needed between invocations of a specific call chain. Provides a simple interface to define different types of delay implementations likeConstant,Exponential.Constant, provides theConstant.nextDelay(int)that waves constantly for the next attempt. When it exceedsConstant#timeout it returnDuration.ZEROto indicate end of delay.Exponential, provide exponential values between [Exponential#minDelay,Exponential#timeout- See Also:
Constant,Exponential,MultipleOf,ShiftByMultipleOf
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DurationnextDelay(int attempt)Returns the new delay amount to stabilize as defined byDurationtime.
-
-
-
Method Detail
-
nextDelay
Duration nextDelay(int attempt)
Returns the new delay amount to stabilize as defined byDurationtime. This returns -1 to indicate that we are done with delays from this instance Different implementations can return different values- Parameters:
attempt- , starts with 1- Returns:
- the next amount to wait for or
Duration.ZEROto indicate delay is complete
-
-