Class BackoffStrategy

java.lang.Object
migratedb.v1.core.internal.strategy.BackoffStrategy

public class BackoffStrategy extends Object
  • 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 with
      exponent - The exponent by which to increase the counter value with on each call to next()
      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