public interface RetryScheduler
Modifier and Type | Method and Description |
---|---|
boolean |
scheduleRetry(CommandMessage commandMessage,
RuntimeException lastFailure,
List<Class<? extends Throwable>[]> failures,
Runnable commandDispatch)
Inspect the given
commandMessage that failed with given lastFailure . |
boolean scheduleRetry(@Nonnull CommandMessage commandMessage, @Nonnull RuntimeException lastFailure, @Nonnull List<Class<? extends Throwable>[]> failures, @Nonnull Runnable commandDispatch)
commandMessage
that failed with given lastFailure
. The given failures
provides a list of previous failures known for this command. The commandDispatch
task can be used to
schedule the command for dispatching.
The return value of this method indicates whether the command has been scheduled for a retry. When true
,
the original callbacks should not be invoked, as command execution is subject to a retry. When false
, the
failure is interpreted as terminal and the callback will be invoked with the last failure recorded.
If the implementation throws an Exception, that exception is passed as the failure to the original callback.commandMessage
- The Command Message being dispatchedlastFailure
- The last failure recorded for this commandfailures
- A condensed view of all known failures of this command. Each element in the array
represents the cause of the element preceding it.commandDispatch
- The task to be executed to retry a commandtrue
if the command has been rescheduled, otherwise false
Copyright © 2010–2024. All rights reserved.