public class Constant extends Object
AbstractDelay.timeout has been reached. After which it will return -1
final Delay delay =
Constant.of().delay(Duration.ofSeconds(5))
.timeout(Duration.ofSeconds(50)).build();
Duration next = Duration.ZERO;
int attempt = 1;
while ((next = fixed.nextDelay(attempt++)) != Duration.ZERO) { accrued +=
next; } Assertions.assertEquals(5*10, accrued); | Modifier and Type | Class and Description |
|---|---|
static class |
Constant.Builder |
| Modifier and Type | Method and Description |
|---|---|
Duration |
nextDelay(int attempt)
Returns the new delay amount to stabilize as defined by
Duration time. |
static Constant.Builder |
of() |
public static Constant.Builder of()
public Duration nextDelay(int attempt)
DelayDuration time. This returns -1 to indicate that we are done
with delays from this instance Different implementations can return different
valuesDuration.ZERO to indicate
delay is completeCopyright © 2019 Amazon Web Services, Inc. All Rights Reserved.