Class BackoffWrapper

java.lang.Object
com.linecorp.armeria.common.util.AbstractUnwrappable<Backoff>
com.linecorp.armeria.client.retry.BackoffWrapper
All Implemented Interfaces:
Backoff, Unwrappable

public class BackoffWrapper extends AbstractUnwrappable<Backoff> implements Backoff
Wraps an existing Backoff.
  • Constructor Details

    • BackoffWrapper

      protected BackoffWrapper(Backoff delegate)
      Creates a BackoffWrapper with the specified delegate.
  • Method Details

    • nextDelayMillis

      public long nextDelayMillis(int numAttemptsSoFar)
      Description copied from interface: Backoff
      Returns the number of milliseconds to wait for before attempting a retry.
      Specified by:
      nextDelayMillis in interface Backoff
      Parameters:
      numAttemptsSoFar - the number of attempts made by a client so far, including the first attempt and its following retries.
      Returns:
      the number of milliseconds to wait for before attempting a retry, or a negative value if no further retry has to be made.