Class RetryImpl<T>
java.lang.Object
io.github.resilience4j.retry.internal.RetryImpl<T>
- All Implemented Interfaces:
Retry
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classfinal classprivate classfinal classNested classes/interfaces inherited from interface Retry
Retry.AsyncContext<T>, Retry.AsyncRetryBlock<T>, Retry.Context<T>, Retry.EventPublisher, Retry.Metrics -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RetryConfigprivate final BiConsumer<Integer, T> private final RetryImpl<T>.RetryEventProcessorprivate final booleanprivate final LongAdderprivate final LongAdderprivate final io.github.resilience4j.core.IntervalBiFunction<T> private final intprivate final Retry.Metricsprivate final String(package private) static io.github.resilience4j.core.functions.CheckedConsumer<Long> private final LongAdderprivate final LongAdder -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a async retry Context.context()Creates a retry Context.Returns an EventPublisher can be used to register event consumers.Get the Metrics of this Retry instance.getName()Returns the ID of this Retry.Returns the RetryConfig of this Retry.getTags()Returns an unmodifiable map with tags assigned to this Retry.private voidpublishRetryEvent(Supplier<RetryEvent> event) static voidsetSleepFunction(io.github.resilience4j.core.functions.CheckedConsumer<Long> sleepFunction) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Retry
executeCallable, executeCheckedSupplier, executeCompletionStage, executeRunnable, executeSupplier
-
Field Details
-
sleepFunction
-
metrics
-
eventProcessor
-
resultPredicate
-
consumeResultBeforeRetryAttempt
-
name
-
config
-
tags
-
maxAttempts
private final int maxAttempts -
failAfterMaxAttempts
private final boolean failAfterMaxAttempts -
intervalBiFunction
-
exceptionPredicate
-
succeededAfterRetryCounter
-
failedAfterRetryCounter
-
succeededWithoutRetryCounter
-
failedWithoutRetryCounter
-
-
Constructor Details
-
RetryImpl
-
RetryImpl
-
-
Method Details
-
setSleepFunction
public static void setSleepFunction(io.github.resilience4j.core.functions.CheckedConsumer<Long> sleepFunction) -
getName
-
context
Description copied from interface:RetryCreates a retry Context. -
asyncContext
Description copied from interface:RetryCreates a async retry Context.- Specified by:
asyncContextin interfaceRetry- Returns:
- the async retry Context
-
getRetryConfig
Description copied from interface:RetryReturns the RetryConfig of this Retry.- Specified by:
getRetryConfigin interfaceRetry- Returns:
- the RetryConfig of this Retry
-
getTags
-
publishRetryEvent
-
getEventPublisher
Description copied from interface:RetryReturns an EventPublisher can be used to register event consumers.- Specified by:
getEventPublisherin interfaceRetry- Returns:
- an EventPublisher
-
getMetrics
Get the Metrics of this Retry instance.- Specified by:
getMetricsin interfaceRetry- Returns:
- the Metrics of this Retry instance
-