Class: AWSCDK::StepFunctions::RetryProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
step_functions/retry_props.rb

Overview

Retry details.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(backoff_rate: nil, errors: nil, interval: nil, jitter_strategy: nil, max_attempts: nil, max_delay: nil) ⇒ RetryProps

Returns a new instance of RetryProps.

Parameters:

  • backoff_rate (Numeric, nil) (defaults to: nil)

    Multiplication for how much longer the wait interval gets on every retry.

  • errors (Array<String>, nil) (defaults to: nil)

    Errors to retry.

  • interval (AWSCDK::Duration, nil) (defaults to: nil)

    How many seconds to wait initially before retrying.

  • jitter_strategy (AWSCDK::StepFunctions::JitterType, nil) (defaults to: nil)

    Introduces a randomization over the retry interval.

  • max_attempts (Numeric, nil) (defaults to: nil)

    How many times to retry this particular error.

  • max_delay (AWSCDK::Duration, nil) (defaults to: nil)

    Maximum limit on retry interval growth during exponential backoff.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'step_functions/retry_props.rb', line 13

def initialize(backoff_rate: nil, errors: nil, interval: nil, jitter_strategy: nil, max_attempts: nil, max_delay: nil)
  @backoff_rate = backoff_rate
  Jsii::Type.check_type(@backoff_rate, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "backoffRate") unless @backoff_rate.nil?
  @errors = errors
  Jsii::Type.check_type(@errors, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "errors") unless @errors.nil?
  @interval = interval
  Jsii::Type.check_type(@interval, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "interval") unless @interval.nil?
  @jitter_strategy = jitter_strategy
  Jsii::Type.check_type(@jitter_strategy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9ucy5KaXR0ZXJUeXBlIn0=")), "jitterStrategy") unless @jitter_strategy.nil?
  @max_attempts = max_attempts
  Jsii::Type.check_type(@max_attempts, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxAttempts") unless @max_attempts.nil?
  @max_delay = max_delay
  Jsii::Type.check_type(@max_delay, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "maxDelay") unless @max_delay.nil?
end

Instance Attribute Details

#backoff_rateNumeric? (readonly)

Note:

Default: 2

Multiplication for how much longer the wait interval gets on every retry.

Returns:

  • (Numeric, nil)


32
33
34
# File 'step_functions/retry_props.rb', line 32

def backoff_rate
  @backoff_rate
end

#errorsArray<String>? (readonly)

Note:

Default: All errors

Errors to retry.

A list of error strings to retry, which can be either predefined errors (for example Errors.NoChoiceMatched) or a self-defined error.

Returns:

  • (Array<String>, nil)


40
41
42
# File 'step_functions/retry_props.rb', line 40

def errors
  @errors
end

#intervalAWSCDK::Duration? (readonly)

Note:

Default: Duration.seconds(1)

How many seconds to wait initially before retrying.

Returns:



45
46
47
# File 'step_functions/retry_props.rb', line 45

def interval
  @interval
end

#jitter_strategyAWSCDK::StepFunctions::JitterType? (readonly)

Note:

Default: - No jitter strategy

Introduces a randomization over the retry interval.



50
51
52
# File 'step_functions/retry_props.rb', line 50

def jitter_strategy
  @jitter_strategy
end

#max_attemptsNumeric? (readonly)

Note:

Default: 3

How many times to retry this particular error.

May be 0 to disable retry for specific errors (in case you have a catch-all retry policy).

Returns:

  • (Numeric, nil)


58
59
60
# File 'step_functions/retry_props.rb', line 58

def max_attempts
  @max_attempts
end

#max_delayAWSCDK::Duration? (readonly)

Note:

Default: - No max delay

Maximum limit on retry interval growth during exponential backoff.

Returns:



63
64
65
# File 'step_functions/retry_props.rb', line 63

def max_delay
  @max_delay
end

Class Method Details

.jsii_propertiesObject



65
66
67
68
69
70
71
72
73
74
# File 'step_functions/retry_props.rb', line 65

def self.jsii_properties
  {
    :backoff_rate => "backoffRate",
    :errors => "errors",
    :interval => "interval",
    :jitter_strategy => "jitterStrategy",
    :max_attempts => "maxAttempts",
    :max_delay => "maxDelay",
  }
end

Instance Method Details

#to_jsiiObject



76
77
78
79
80
81
82
83
84
85
86
87
# File 'step_functions/retry_props.rb', line 76

def to_jsii
  result = {}
  result.merge!({
    "backoffRate" => @backoff_rate,
    "errors" => @errors,
    "interval" => @interval,
    "jitterStrategy" => @jitter_strategy,
    "maxAttempts" => @max_attempts,
    "maxDelay" => @max_delay,
  })
  result.compact
end