Uses of Record Class
io.github.teceli.resiliencia.patterns.retry.Retry
Packages that use Retry
-
Uses of Retry in io.github.teceli.resiliencia.patterns.retry
Methods in io.github.teceli.resiliencia.patterns.retry that return RetryModifier and TypeMethodDescriptionstatic <T> Retry<T> ARetryinstance configured with sensible defaults, ready to use as-is or refine further viawithXmethods.Retry.withBackoffMultiplier(double multiplier) Factor each backoff delay is multiplied by after every failed attempt, producing exponential growth fromwithInitialDelay(long).Use a customClockinstead of the system clock, e.g. a manual/virtual clock in tests to make backoff assertions deterministic and instant.Retry.withInitialDelay(long delayMs) Delay before the first retry attempt.Retry.withJitter(double jitterFactor) Randomize each backoff delay uniformly within[delay * (1 - factor), delay * (1 + factor)]to spread out retries from many clients that failed at the same moment (thundering herd).Retry.withListener(ResilienceEvent.Listener listener) Add a listener notified of everyRetryEventemitted by this instance.Retry.withMaxAttempts(int maxAttempts) Maximum number of attempts, including the first one —withMaxAttempts(1)disables retrying entirely.Retry.withMaxDelay(long maxDelayMs) Cap every backoff delay (including the initial one, after jitter) at the given value, preventing unbounded exponential growth.Retry.withOverallDeadline(long overallDeadlineMs) Bound the total wall-clock time this retry loop is willing to spend across all attempts and backoff waits, measured from the first attempt.Retry.withShouldRetry(Predicate<Throwable> predicate) Decide, for each thrown exception, whether it is worth retrying.