Class Retry.Builder
java.lang.Object
co.yellowdog.platform.clients.retry.Retry.Builder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbeforeRetry
(@NonNull RetryHandler retryHandler) build()
maxAttempts
(long maxAttempts) The maximum number of attempts to retry.maxBackoffPeriod
(@NonNull Duration maxBackoffPeriod) The maximum backoff period.The predicate to determine if a retry should be attempted.
-
Constructor Details
-
Builder
-
-
Method Details
-
maxBackoffPeriod
The maximum backoff period. By default, the backoff period will never stop increasing.- Parameters:
maxBackoffPeriod
- the maximum backoff period.- Returns:
- this builder.
-
maxAttempts
The maximum number of attempts to retry. By default, will retry indefinitely. An exception will be thrown if the maximum number of attempts is reached.- Parameters:
maxAttempts
- the maximum number of attempts.- Returns:
- this builder.
- Throws:
IllegalArgumentException
- if maxAttempts is less than 0.
-
retryOn
The predicate to determine if a retry should be attempted. By default, will retry on any throwable.- Parameters:
retryOnPredicate
- the predicate to determine if a retry should be attempted.- Returns:
- this builder.
-
beforeRetry
-
build
-