Class RetryImpl.AsyncContextImpl

java.lang.Object
io.github.resilience4j.retry.internal.RetryImpl.AsyncContextImpl
All Implemented Interfaces:
Retry.AsyncContext<T>
Enclosing class:
RetryImpl<T>

public final class RetryImpl.AsyncContextImpl extends Object implements Retry.AsyncContext<T>
  • Constructor Details

    • AsyncContextImpl

      public AsyncContextImpl()
  • Method Details

    • onComplete

      public void onComplete()
      Description copied from interface: Retry.AsyncContext
      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.
      Specified by:
      onComplete in interface Retry.AsyncContext<T>
    • onError

      public long onError(Throwable throwable)
      Description copied from interface: Retry.AsyncContext
      Records an failed call.
      Specified by:
      onError in interface Retry.AsyncContext<T>
      Parameters:
      throwable - the exception to handle
      Returns:
      delay in milliseconds until the next try
    • onResult

      public long onResult(T result)
      Description copied from interface: Retry.AsyncContext
      check the result call.
      Specified by:
      onResult in interface Retry.AsyncContext<T>
      Parameters:
      result - the result to validate
      Returns:
      delay in milliseconds until the next try if the result match the predicate