Class RetryImpl.AsyncContextImpl
java.lang.Object
io.github.resilience4j.retry.internal.RetryImpl.AsyncContextImpl
- All Implemented Interfaces:
Retry.AsyncContext<T>
public final class RetryImpl.AsyncContextImpl extends java.lang.Object implements Retry.AsyncContext<T>
-
Constructor Summary
Constructors Constructor Description AsyncContextImpl() -
Method Summary
Modifier and Type Method Description voidonComplete()Records a successful call or retryable call with the needed generated retry events.longonError(java.lang.Throwable throwable)Records an failed call.longonResult(T result)check the result call.voidonSuccess()Deprecated.since 1.2.0
-
Constructor Details
-
AsyncContextImpl
public AsyncContextImpl()
-
-
Method Details
-
onSuccess
@Deprecated public void onSuccess()Deprecated.since 1.2.0Description copied from interface:Retry.AsyncContextRecords a successful call.- Specified by:
onSuccessin interfaceRetry.AsyncContext<T>
-
onComplete
public void onComplete()Description copied from interface:Retry.AsyncContextRecords 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 generateRetryOnSuccessEvent. When the retry reach the max retries limit, it will generateRetryOnErrorEventwith last exception orMaxRetriesExceededif no other exception is thrown.- Specified by:
onCompletein interfaceRetry.AsyncContext<T>
-
onError
public long onError(java.lang.Throwable throwable)Description copied from interface:Retry.AsyncContextRecords an failed call.- Specified by:
onErrorin interfaceRetry.AsyncContext<T>- Parameters:
throwable- the exception to handle- Returns:
- delay in milliseconds until the next try
-
onResult
Description copied from interface:Retry.AsyncContextcheck the result call.- Specified by:
onResultin interfaceRetry.AsyncContext<T>- Parameters:
result- the result to validate- Returns:
- delay in milliseconds until the next try if the result match the predicate
-