Class: AWS::Flow::RetryOptions

Inherits:
Options
  • Object
show all
Defined in:
lib/aws/decider/options.rb

Overview

Direct Known Subclasses

ExponentialRetryOptions

Instance Attribute Summary

Attributes included from Utilities::UpwardLookups

#precursors

Attributes included from Utilities::UpwardLookups::InstanceMethods

#precursors

Instance Method Summary collapse

Methods inherited from Options

#get_options, inherited, #method_missing

Methods included from Utilities::UpwardLookups

#held_properties, #properties, #property

Methods included from Utilities::UpwardLookups::InstanceMethods

#look_upwards

Constructor Details

#initialize(hash = {}, use_defaults = false) ⇒ RetryOptions

Creates a new AWS::Flow::RetryOptions instance.

Parameters:

  • hash (Hash) (defaults to: {})

    The set of default RetryOptions.

  • use_defaults (true, false) (defaults to: false)

    If set to ‘true`, the default options specified will be used as the runtime options.

Options Hash (hash):

  • :is_retryable_function (Object)

    The function used to test if the activity is retryable.

  • :exceptions_to_allow (Integer)

    The number of exceptions to allow.

  • :maximum_attempts (Integer)

    The maximum number of attempts to make before the task is marked as failed.

  • :maximum_retry_interval_seconds (Integer)

    The maximum retry interval, in seconds.

  • :exceptions_to_retry (Array)

    The list of exceptions that will cause a retry attempt.

  • :exceptions_to_exclude (Array)

    The list of exceptions to exclude from retry.

  • :jitter_function (Object)

    The jitter function used to modify the actual retry time.

  • :retries_per_exception (Integer)

    The number of retries to make per exception.

  • :retry_function (Object)

    The retry function to use.



268
269
270
# File 'lib/aws/decider/options.rb', line 268

def initialize(hash={}, use_defaults=false)
  super(hash, use_defaults)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class AWS::Flow::Options

Instance Method Details

#isRetryable(failure) ⇒ true, false

Tests whether this activity can be retried based on the ‘:exceptions_to_retry` and `:exceptions_to_exclude` options.

Parameters:

  • failure (Object)

    The failure type to test.

Returns:

  • (true, false)

    Returns ‘true` if the activity can be retried; `false` otherwise.



281
282
283
284
285
286
287
288
289
# File 'lib/aws/decider/options.rb', line 281

def isRetryable(failure)
  #TODO stuff about checking for a DecisionException, getting cause if so
  is_retryable = false
  is_retryable = @exceptions_to_retry.reject {|exception| failure.class <= exception}.empty?
  if is_retryable
    is_retryable = @exceptions_to_exclude.select{|exception| failure.class <= exception}.empty?
  end
  return is_retryable
end