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 Type
    Method
    Description
    An immutable copy of this Retry.RetrySignal which is guaranteed to give a consistent view of the state at the time at which this method is invoked.
    The Throwable that caused the current onError signal.
    default ContextView
    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.
    long
    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).
    long
    Retry counter resetting after each onNext (in other words the number of errors -1 since the latest onNext).
  • 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 each onNext (in other words the number of errors -1 since the latest onNext).
      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 any onNext signals (in which case totalRetries() and totalRetriesInARow() are equivalent).
    • failure

      Throwable failure()
      The Throwable that caused the current onError signal.
      Returns:
      the current failure.
    • retryContextView

      default ContextView 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

      default Retry.RetrySignal copy()
      An immutable copy of this Retry.RetrySignal which is guaranteed to give a consistent view of the state at the time at which this method is invoked. This is especially useful if this Retry.RetrySignal is a transient view of the state of the underlying retry subscriber.
      Returns:
      an immutable copy of the current Retry.RetrySignal, always safe to use