Interface Retry.AsyncContext<T>

All Known Implementing Classes:
RetryImpl.AsyncContextImpl
Enclosing interface:
Retry

public static interface Retry.AsyncContext<T>
  • Method Summary

    Modifier and Type Method Description
    void onComplete()
    Records a successful call or retryable call with the needed generated retry events.
    long onError​(java.lang.Throwable throwable)
    Records an failed call.
    long onResult​(T result)
    check the result call.
    void onSuccess()
    Deprecated.
    since 1.2.0
  • Method Details

    • onSuccess

      @Deprecated void onSuccess()
      Deprecated.
      since 1.2.0
      Records a successful call.
    • onComplete

      void onComplete()
      Records a successful call or retryable call with the needed generated retry events. When there is a successful retry before reaching the max retries limit, it will generate RetryOnSuccessEvent. When the retry reach the max retries limit, it will generate RetryOnErrorEvent with last exception or MaxRetriesExceeded if no other exception is thrown.
    • onError

      long onError​(java.lang.Throwable throwable)
      Records an failed call.
      Parameters:
      throwable - the exception to handle
      Returns:
      delay in milliseconds until the next try
    • onResult

      long onResult​(T result)
      check the result call.
      Parameters:
      result - the result to validate
      Returns:
      delay in milliseconds until the next try if the result match the predicate