public class Blended extends Object implements Delay
Duration.ZERO. This is useful to model blends
in the delays where on can be quick for the first set of delays using
Constant and then become MultipleOf or Exponential
thereafter.
final Delay delay = Blended.of()
.add(
Constant.of().delay(Duration.ofSeconds(5))
.timeout(Duration.ofSeconds(20)).build())
.add(ShiftByMultipleOf.shiftedOf()
.delay(Duration.ofSeconds(5)).timeout(Duration.ofSeconds(220))
.build())
.build();
The above delay provides the following set of 5, 10, 15, 20, 40, 90, 150, 220| Modifier and Type | Class and Description |
|---|---|
static class |
Blended.BlendedBuilder |
| Modifier and Type | Method and Description |
|---|---|
Duration |
nextDelay(int attempt)
Returns the new delay amount to stabilize as defined by
Duration time. |
static Blended.BlendedBuilder |
of() |
public static Blended.BlendedBuilder 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
valuesnextDelay in interface DelayDuration.ZERO to indicate
delay is completeCopyright © 2019 Amazon Web Services, Inc. All Rights Reserved.