@NoImplement public interface RetryPolicy
PolicyStatus
which indicates whether the
policy is exhausted or should continue to retry.Modifier and Type | Method and Description |
---|---|
default <T> org.reactivestreams.Publisher<T> |
applyPolicy(org.reactivestreams.Publisher<T> publisher,
Predicate<Throwable> shouldRetry,
Consumer<Throwable> onExhausted,
Function<Throwable,Throwable> errorFunction)
Applies the retry policy in a non blocking manner by transforming the given
publisher into one configured to apply
the retry logic. |
PolicyStatus |
applyPolicy(Throwable cause)
Applies the retry policy by performing a blocking action.
|
PolicyStatus applyPolicy(Throwable cause)
cause
- the failure which causes the retryPolicyStatus
default <T> org.reactivestreams.Publisher<T> applyPolicy(org.reactivestreams.Publisher<T> publisher, Predicate<Throwable> shouldRetry, Consumer<Throwable> onExhausted, Function<Throwable,Throwable> errorFunction)
publisher
into one configured to apply
the retry logic.T
- the generic type of the publisher's contentpublisher
- a publisher with the items which might failshouldRetry
- a predicate which evaluates each item to know if it should be retried or notonExhausted
- an action to perform when the retry action has been exhaustederrorFunction
- function used to map cause exception to exception emitted by retry policy.Publisher
configured with the retry policy.Copyright © 2018. All rights reserved.