Package com.dianxin.tori.base.concurrent
Interface Retry.RetryContext
- Enclosing interface:
Retry
@NullMarked
public static interface Retry.RetryContext
Encapsulates runtime contextual metadata associated with the current retry iteration.
-
Method Summary
Modifier and TypeMethodDescriptionThe exception that caused the previous execution attempt to fail.longThe current attempt index of the retry lifecycle (1-based index).longThe total maximum number of retries configured in the strategy.
-
Method Details
-
iteration
long iteration()The current attempt index of the retry lifecycle (1-based index).- Returns:
- The current iteration number.
-
totalRetries
long totalRetries()The total maximum number of retries configured in the strategy.- Returns:
- The maximum allowable attempts.
-
exception
Throwable exception()The exception that caused the previous execution attempt to fail.- Returns:
- The root or wrapped
Throwable.
-