Class BackoffStrategy
java.lang.Object
migratedb.v1.core.internal.strategy.BackoffStrategy
-
Constructor Summary
ConstructorsConstructorDescriptionBackoffStrategy(int initial, int exponent, int interval) Constructs an exponential backoff counter. -
Method Summary
-
Constructor Details
-
BackoffStrategy
public BackoffStrategy(int initial, int exponent, int interval) Constructs an exponential backoff counter.- Parameters:
initial- The initial integer to start the counter withexponent- The exponent by which to increase the counter value with on each call tonext()interval- The maximum time between retries in seconds
-
-
Method Details
-
next
public int next()- Returns:
- The current value of the counter and immediately updates it with the next value
-
peek
public int peek()- Returns:
- The current value of the counter without updating it
-