Package reactor.util.retry
Interface Retry.RetrySignal
- Enclosing class:
- Retry
public static interface Retry.RetrySignal
State used in
Flux.retryWhen(Retry) and Mono.retryWhen(Retry),
providing the Throwable that caused the source to fail as well as counters keeping track of retries.-
Method Summary
Modifier and TypeMethodDescriptiondefault Retry.RetrySignalcopy()An immutable copy of thisRetry.RetrySignalwhich is guaranteed to give a consistent view of the state at the time at which this method is invoked.failure()default ContextViewReturn a read-only view of the user provided context, which may be used to store objects to be reset/rolled-back or otherwise mutated before or after a retry.longThe total number of retries since the source first was subscribed to (in other words the number of errors -1 since the source was first subscribed to).long
-
Method Details
-
totalRetries
long totalRetries()The total number of retries since the source first was subscribed to (in other words the number of errors -1 since the source was first subscribed to).- Returns:
- the total number of retries since the source first was subscribed to.
-
totalRetriesInARow
long totalRetriesInARow()Retry counter resetting after eachonNext(in other words the number of errors -1 since the latestonNext).- Returns:
- the number of retries since the latest
onNext, or the number of retries since the source first was subscribed to if there hasn't been anyonNextsignals (in which casetotalRetries()andtotalRetriesInARow()are equivalent).
-
failure
Throwable failure()- Returns:
- the current failure.
-
retryContextView
Return a read-only view of the user provided context, which may be used to store objects to be reset/rolled-back or otherwise mutated before or after a retry.- Returns:
- a read-only view of a user provided context.
-
copy
An immutable copy of thisRetry.RetrySignalwhich is guaranteed to give a consistent view of the state at the time at which this method is invoked. This is especially useful if thisRetry.RetrySignalis a transient view of the state of the underlying retry subscriber.- Returns:
- an immutable copy of the current
Retry.RetrySignal, always safe to use
-