Class RetryHandler

java.lang.Object
io.spiffe.workloadapi.retry.RetryHandler

public class RetryHandler extends Object
Provides methods to schedule the execution of retries based on a backoff policy.
  • Constructor Details

  • Method Details

    • scheduleRetry

      public void scheduleRetry(Runnable runnable)
      Schedule to execute a Runnable, based on the backoff policy Updates the next delay and retries count.
      Parameters:
      runnable - the task to be scheduled for execution
    • shouldRetry

      public boolean shouldRetry()
      Returns true is a new retry should be performs, according the the Retry Policy.
      Returns:
      true is a new retry should be performs, according the the Retry Policy
    • reset

      public void reset()
      Reset state of RetryHandle to initial values.
    • getNextDelay

      public Duration getNextDelay()
    • getRetryCount

      public int getRetryCount()