public interface Delay
Delay that you needed between invocations
of a specific call chain. Provides a simple interface to define different
types of delay implementations like
Constant,
Exponential.
Constant, provides the
Constant.nextDelay(int)
that waves constantly for the next attempt. When it exceeds
Constant#timeout it return
Duration.ZERO to indicate end of delay.
Exponential, provide
exponential values between
[Exponential#minDelay,
Exponential#timeoutConstant,
Exponential,
MultipleOf,
ShiftByMultipleOf| Modifier and Type | Method and Description |
|---|---|
Duration |
nextDelay(int attempt)
Returns the new delay amount to stabilize as defined by
Duration time. |
Duration nextDelay(int attempt)
Duration time. This returns -1 to indicate that we are done
with delays from this instance Different implementations can return different
valuesattempt, - starts with 1Duration.ZERO to indicate
delay is completeCopyright © 2019 Amazon Web Services, Inc. All Rights Reserved.