Package money.zumo.zumokit
Class FuzzingBackOffGenerator
- java.lang.Object
-
- money.zumo.zumokit.FuzzingBackOffGenerator
-
public class FuzzingBackOffGenerator extends java.lang.Object
Simple fibonacci back off with fuzzing. This is important for reconnection so that everyone doesn't retry at the same time.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FuzzingBackOffGenerator.BackOffParameters
-
Constructor Summary
Constructors Constructor Description FuzzingBackOffGenerator(int initialBackOff, int maxBackOff, double randomizationFactor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FuzzingBackOffGenerator.BackOffParameters
next()
Gets the next back off time.void
reset()
Resets the back off.
-
-
-
Constructor Detail
-
FuzzingBackOffGenerator
public FuzzingBackOffGenerator(int initialBackOff, int maxBackOff, double randomizationFactor)
- Parameters:
initialBackOff
- Initial value to back off. This class does not interpret the meaning of this value. must be > 0maxBackOff
- Max value to back offrandomizationFactor
- between 0 and 1 to control the range of randomness.
-
-
Method Detail
-
next
public FuzzingBackOffGenerator.BackOffParameters next()
Gets the next back off time. Until maxBackOff is reached.
-
reset
public void reset()
Resets the back off.
-
-