Interface RetryHandler

All Known Implementing Classes:
NeverRetryHandler, SimpleRetryHandler

public interface RetryHandler
An interface for handling retries.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Duration
     
  • Method Summary

    Modifier and Type
    Method
    Description
    shouldRetry(int attempts, CdpClientException exception)
    Returns the duration the caller need to wait before retrying or null if no retry should be attempted according to the retry policy.
  • Field Details

    • DO_NOT_RETRY

      static final Duration DO_NOT_RETRY
  • Method Details

    • shouldRetry

      Duration shouldRetry(int attempts, CdpClientException exception)
      Returns the duration the caller need to wait before retrying or null if no retry should be attempted according to the retry policy.
      Parameters:
      attempts - the number of attempts so far
      exception - the request exception
      Returns:
      the duration to wait for the next attempt or null if no retry should be attempted