Class ExponentialBackoffRetryPolicy

java.lang.Object
tech.ydb.yoj.util.retry.ExponentialBackoffRetryPolicy
All Implemented Interfaces:
RetryPolicy

public class ExponentialBackoffRetryPolicy extends Object implements RetryPolicy
  • Field Details

  • Constructor Details

    • ExponentialBackoffRetryPolicy

      @ConstructorProperties({"initial","max","jitter","multiplier"}) public ExponentialBackoffRetryPolicy(long initial, long max, double jitter, double multiplier)
  • Method Details

    • calcDuration

      public Duration calcDuration(int attempt)
      Specified by:
      calcDuration in interface RetryPolicy
      Parameters:
      attempt - failed attempt number, counting from 1
      Returns:
      recommended retry interval
    • isSameAs

      public boolean isSameAs(@Nullable RetryPolicy other)
      Specified by:
      isSameAs in interface RetryPolicy