Interface Jitter
-
- All Superinterfaces:
Function<BackoffDelay,Duration>
public interface Jitter extends Function<BackoffDelay,Duration>
Jitter function that is applied to the backoff delay.
-
-
Field Summary
Fields Modifier and Type Field Description static Jitter
NO_JITTER
static Jitter
RANDOM_JITTER
-
Method Summary
Static Methods Modifier and Type Method Description static Jitter
noJitter()
Jitter function that is a no-op.static Jitter
random()
Jitter function that applies a random jitter with a factor of 0.5, generating a backoff between[d - d*0.5; d + d*0.5]
(but still within the limits of [BackoffDelay.minDelay()
;BackoffDelay.maxDelay()
].static Jitter
random(double randomFactor)
Jitter function that applies a random jitter with a provided [0; 1] factor (default 0.5), generating a backoff between[d - d*factor; d + d*factor]
(but still within the limits of [BackoffDelay.minDelay()
;BackoffDelay.maxDelay()
].
-
-
-
Method Detail
-
noJitter
static Jitter noJitter()
Jitter function that is a no-op.- Returns:
- Jitter function that does not apply any jitter
-
random
static Jitter random()
Jitter function that applies a random jitter with a factor of 0.5, generating a backoff between[d - d*0.5; d + d*0.5]
(but still within the limits of [BackoffDelay.minDelay()
;BackoffDelay.maxDelay()
].- Returns:
- Jitter function to randomize backoff delay
-
random
static Jitter random(double randomFactor)
Jitter function that applies a random jitter with a provided [0; 1] factor (default 0.5), generating a backoff between[d - d*factor; d + d*factor]
(but still within the limits of [BackoffDelay.minDelay()
;BackoffDelay.maxDelay()
].- Returns:
- Jitter function to randomize backoff delay
-
-