Class RetryOperation<T>
java.lang.Object
org.sentrysoftware.metricshub.engine.strategy.utils.RetryOperation<T>
- Type Parameters:
T- The type of the result produced by the operation.
The
RetryOperation class provides a mechanism for retrying a function that may throw a RetryableException.
It allows configuring the number of retries, the wait strategy between retries, and handles the retry logic.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionExecute the function, if it fails with theRetryableException, retry the function.
-
Constructor Details
-
RetryOperation
public RetryOperation()
-
-
Method Details
-
run
Execute the function, if it fails with theRetryableException, retry the function.- Parameters:
function- operation to execute that produces a result- Returns:
- The value returned by the function or default value if all retries fail
-