Package io.bdeploy.common
Class RetryableScope
java.lang.Object
io.bdeploy.common.RetryableScope
-
Method Summary
Modifier and TypeMethodDescriptionstatic RetryableScopecreate()voidPerform the given action.withDelay(long ms) Sets the timeout the default exception handler will delay retries in milliseconds.Replaces the default exception handler (including delay handling of retries) with a custom one.withMaxRetries(long amount) Sets the amount of retries that the action will be re-called in case of an exception.
-
Method Details
-
create
-
withExceptionHandler
Replaces the default exception handler (including delay handling of retries) with a custom one. -
withDelay
Sets the timeout the default exception handler will delay retries in milliseconds. The default is 100ms. -
withMaxRetries
Sets the amount of retries that the action will be re-called in case of an exception. The default is 10. -
run
Perform the given action. Retry execution up towithMaxRetries(long)trimes, with a delay ofwithDelay(long)milliseconds between retries (given the exception and timeout handler has not been replaced usingwithExceptionHandler(Consumer)).
-