Class RetryDecision

java.lang.Object
software.amazon.lambda.durable.retry.RetryDecision

public class RetryDecision extends Object
Represents a decision about whether to retry a failed operation and how long to wait.
  • Method Details

    • retry

      public static RetryDecision retry(Duration delay)
      Creates a retry decision indicating the operation should be retried after the specified delay.
      Parameters:
      delay - the duration to wait before retrying
      Returns:
      a RetryDecision indicating retry with the specified delay
    • fail

      public static RetryDecision fail()
      Creates a retry decision indicating the operation should not be retried.
      Returns:
      a RetryDecision indicating no retry should be attempted
    • shouldRetry

      public boolean shouldRetry()
      Returns:
      true if the operation should be retried, false otherwise
    • delay

      public Duration delay()
      Returns:
      the duration to wait before retrying, or Duration.ZERO if no retry
    • toString

      public String toString()
      Overrides:
      toString in class Object