Class: AWS::Flow::ActivityOptions
- Defined in:
- lib/aws/decider/options.rb
Overview
Options to use on an activity or decider. The following options are defined:
Direct Known Subclasses
Class Attribute Summary collapse
-
.default_options ⇒ Object
readonly
Returns the value of attribute default_options.
-
.runtime_options ⇒ Object
readonly
Returns the value of attribute runtime_options.
Instance Attribute Summary collapse
-
#default_task_heartbeat_timeout ⇒ Object
The optional default maximum time, specified when registering the activity type, before which a worker processing a task must report progress by calling record_heartbeat on the ‘ActivityTask`.
-
#default_task_list ⇒ Object
The optional default task list specified for this activity type at registration.
-
#default_task_schedule_to_close_timeout ⇒ Object
The optional default maximum duration, specified when registering the activity type, for tasks of this activity type.
-
#default_task_schedule_to_start_timeout ⇒ Object
The optional default maximum duration, specified when registering the activity type, that a task of an activity type can wait before being assigned to a worker.
-
#default_task_start_to_close_timeout ⇒ Object
The optional default maximum duration for tasks of an activity type specified when registering the activity type.
Attributes included from Utilities::UpwardLookups
Attributes included from Utilities::UpwardLookups::InstanceMethods
Instance Method Summary collapse
-
#activity_name ⇒ String
Gets the activity prefix name.
-
#activity_name=(value) ⇒ Object
Sets the activity prefix name.
-
#exponential_retry(&block) ⇒ Object
Retries the supplied block with exponential retry logic.
-
#get_default_options ⇒ Hash
Retrieves the default options for this activity.
-
#get_full_options ⇒ Hash
Retrieves the runtime options for this activity.
-
#get_runtime_options ⇒ Hash
Retrieves the runtime options for this activity.
-
#initialize(default_options = {}, use_defaults = false) ⇒ ActivityOptions
constructor
Creates a new set of ‘ActivityOptions`.
Methods inherited from Options
#get_options, inherited, #method_missing
Methods included from Utilities::UpwardLookups
#held_properties, #properties, #property
Methods included from Utilities::UpwardLookups::InstanceMethods
Constructor Details
#initialize(default_options = {}, use_defaults = false) ⇒ ActivityOptions
Creates a new set of ‘ActivityOptions`.
653 654 655 656 657 658 |
# File 'lib/aws/decider/options.rb', line 653 def initialize(={}, use_defaults=false) if .keys.include? :exponential_retry @_exponential_retry = ExponentialRetryOptions.new([:exponential_retry]) end super(, use_defaults) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class AWS::Flow::Options
Class Attribute Details
.default_options ⇒ Object (readonly)
Returns the value of attribute default_options.
572 573 574 |
# File 'lib/aws/decider/options.rb', line 572 def @default_options end |
.runtime_options ⇒ Object (readonly)
Returns the value of attribute runtime_options.
572 573 574 |
# File 'lib/aws/decider/options.rb', line 572 def @runtime_options end |
Instance Attribute Details
#default_task_heartbeat_timeout ⇒ Object
The optional default maximum time, specified when registering the activity type, before which a worker processing a task must report progress by calling record_heartbeat on the ‘ActivityTask`.
You can override this default when scheduling a task through the ‘ScheduleActivityTask` decision. If the activity worker subsequently attempts to record a heartbeat or returns a result, the activity worker receives an UnknownResource fault. In this case, Amazon SWF no longer considers the activity task to be valid; the activity worker should clean up the activity task.
The valid values are integers greater than or equal to zero. An integer value can be used to specify the duration in seconds while “NONE” can be used to specify unlimited duration.
569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 |
# File 'lib/aws/decider/options.rb', line 569 class ActivityOptions < Options class << self attr_reader :default_options, :runtime_options end properties(:default_task_heartbeat_timeout, :default_task_list, :default_task_schedule_to_close_timeout, :default_task_schedule_to_start_timeout, :default_task_start_to_close_timeout, :heartbeat_timeout, :task_list, :schedule_to_close_timeout, :schedule_to_start_timeout, :start_to_close_timeout, :version, :input) property(:manual_completion, [lambda {|x| x == true}]) property(:data_converter, []) default_classes << ActivityDefaults.new # Gets the activity prefix name. # # @return [String] # The activity name. # def activity_name @prefix_name end # Sets the activity prefix name. # # @param [String] value # The activity name to set. # def activity_name=(value) @prefix_name = value end # Creates a new set of `ActivityOptions`. # # @param [Hash] default_options # A set of `ActivityOptions` to use as the default values. # # @option default_options [Integer] :heartbeat_timeout # The optional default maximum time, specified when registering the # activity type, before which a worker processing a task must report # progress by calling `RecordActivityTaskHeartbeat`. # # You can override this default when scheduling a task through the # `ScheduleActivityTask` decision. If the activity worker subsequently # attempts to record a heartbeat or returns a result, the activity # worker receives an UnknownResource fault. In this case, Amazon SWF no # longer considers the activity task to be valid; the activity worker # should clean up the activity task. # # @option default_options [Integer] :schedule_to_close_timeout # The optional default maximum duration, specified when registering the # activity type, for tasks of this activity type. # # You can override this default when scheduling a task through the # `ScheduleActivityTask` decision. # # @option default_options [Integer] :schedule_to_start_timeout # The optional default maximum duration, specified when registering the # activity type, that a task of an activity type can wait before being # assigned to a worker. # # You can override this default when scheduling a task through the # `ScheduleActivityTask` decision. # # @option default_options [Integer] :start_to_close_timeout # The optional default maximum duration for tasks of an activity type # specified when registering the activity type. # # You can override this default when scheduling a task through the # `ScheduleActivityTask` decision. # # @option default_options [Array] :task_list # The optional default task list specified for this activity type at # registration. This default task list is used if a task list is not # provided when a task is scheduled through the ScheduleActivityTask # decision. # # You can override this default when scheduling a task through the # `ScheduleActivityTask` decision. # # @option default_options [String] :version # The version of this activity. If you change any other options on the # activity, you must also change the version. # # @param [true, false] use_defaults # Set to `true` to use the pre-defined {ActivityDefaults}. # def initialize(={}, use_defaults=false) if .keys.include? :exponential_retry @_exponential_retry = ExponentialRetryOptions.new([:exponential_retry]) end super(, use_defaults) end # Retrieves the runtime options for this activity. The runtime options returned are: # # * :heartbeat_timeout # * :task_list # * :schedule_to_close_timeout # * :schedule_to_start_timeout # * :start_to_close_timeout # # For a description of each of these options, see {#initialize}. # # @return [Hash] # The runtime option names and their current values. # def result = ([:heartbeat_timeout, :task_list, :schedule_to_close_timeout, :schedule_to_start_timeout, :start_to_close_timeout]) = ([:default_task_heartbeat_timeout, :default_task_schedule_to_close_timeout, :default_task_schedule_to_start_timeout, :default_task_start_to_close_timeout]) default_option_keys, default_option_values = .keys, .values default_option_keys.map! { |option| option.to_s.gsub(/default_task_/, "").to_sym } default_hash = Hash[default_option_keys.zip(default_option_values)] default_hash.merge(result) end property(:_exponential_retry, []) # Retries the supplied block with exponential retry logic. # # @param [Hash] block # A hash of {ExponentialRetryOptions}. # def exponential_retry(&block) = Utilities::(ExponentialRetryOptions, block) @_exponential_retry = end # Retrieves the runtime options for this activity. # # @return [Hash] # A hash containing the runtime option names and their current values. # def = self. [:task_list, :version, :_exponential_retry, :prefix_name, :return_on_start, :manual_completion, :data_converter].each do |attribute| .merge!(attribute => self.send(attribute)) if self.send(attribute) end end # Retrieves the default options for this activity. # # @return [Hash] # A hash containing the default option names and their current values. # # The options retrieved are: # # * :default_task_heartbeat_timeout # * :default_task_schedule_to_close_timeout # * :default_task_schedule_to_start_timeout # * :default_task_start_to_close_timeout # def ([:default_task_heartbeat_timeout, :default_task_schedule_to_close_timeout, :default_task_schedule_to_start_timeout, :default_task_start_to_close_timeout]) end end |
#default_task_list ⇒ Object
The optional default task list specified for this activity type at registration. This default task list is used if a task list is not provided when a task is scheduled through the ‘ScheduleActivityTask` decision. You can override this default when scheduling a task through the `ScheduleActivityTask` decision.
569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 |
# File 'lib/aws/decider/options.rb', line 569 class ActivityOptions < Options class << self attr_reader :default_options, :runtime_options end properties(:default_task_heartbeat_timeout, :default_task_list, :default_task_schedule_to_close_timeout, :default_task_schedule_to_start_timeout, :default_task_start_to_close_timeout, :heartbeat_timeout, :task_list, :schedule_to_close_timeout, :schedule_to_start_timeout, :start_to_close_timeout, :version, :input) property(:manual_completion, [lambda {|x| x == true}]) property(:data_converter, []) default_classes << ActivityDefaults.new # Gets the activity prefix name. # # @return [String] # The activity name. # def activity_name @prefix_name end # Sets the activity prefix name. # # @param [String] value # The activity name to set. # def activity_name=(value) @prefix_name = value end # Creates a new set of `ActivityOptions`. # # @param [Hash] default_options # A set of `ActivityOptions` to use as the default values. # # @option default_options [Integer] :heartbeat_timeout # The optional default maximum time, specified when registering the # activity type, before which a worker processing a task must report # progress by calling `RecordActivityTaskHeartbeat`. # # You can override this default when scheduling a task through the # `ScheduleActivityTask` decision. If the activity worker subsequently # attempts to record a heartbeat or returns a result, the activity # worker receives an UnknownResource fault. In this case, Amazon SWF no # longer considers the activity task to be valid; the activity worker # should clean up the activity task. # # @option default_options [Integer] :schedule_to_close_timeout # The optional default maximum duration, specified when registering the # activity type, for tasks of this activity type. # # You can override this default when scheduling a task through the # `ScheduleActivityTask` decision. # # @option default_options [Integer] :schedule_to_start_timeout # The optional default maximum duration, specified when registering the # activity type, that a task of an activity type can wait before being # assigned to a worker. # # You can override this default when scheduling a task through the # `ScheduleActivityTask` decision. # # @option default_options [Integer] :start_to_close_timeout # The optional default maximum duration for tasks of an activity type # specified when registering the activity type. # # You can override this default when scheduling a task through the # `ScheduleActivityTask` decision. # # @option default_options [Array] :task_list # The optional default task list specified for this activity type at # registration. This default task list is used if a task list is not # provided when a task is scheduled through the ScheduleActivityTask # decision. # # You can override this default when scheduling a task through the # `ScheduleActivityTask` decision. # # @option default_options [String] :version # The version of this activity. If you change any other options on the # activity, you must also change the version. # # @param [true, false] use_defaults # Set to `true` to use the pre-defined {ActivityDefaults}. # def initialize(={}, use_defaults=false) if .keys.include? :exponential_retry @_exponential_retry = ExponentialRetryOptions.new([:exponential_retry]) end super(, use_defaults) end # Retrieves the runtime options for this activity. The runtime options returned are: # # * :heartbeat_timeout # * :task_list # * :schedule_to_close_timeout # * :schedule_to_start_timeout # * :start_to_close_timeout # # For a description of each of these options, see {#initialize}. # # @return [Hash] # The runtime option names and their current values. # def result = ([:heartbeat_timeout, :task_list, :schedule_to_close_timeout, :schedule_to_start_timeout, :start_to_close_timeout]) = ([:default_task_heartbeat_timeout, :default_task_schedule_to_close_timeout, :default_task_schedule_to_start_timeout, :default_task_start_to_close_timeout]) default_option_keys, default_option_values = .keys, .values default_option_keys.map! { |option| option.to_s.gsub(/default_task_/, "").to_sym } default_hash = Hash[default_option_keys.zip(default_option_values)] default_hash.merge(result) end property(:_exponential_retry, []) # Retries the supplied block with exponential retry logic. # # @param [Hash] block # A hash of {ExponentialRetryOptions}. # def exponential_retry(&block) = Utilities::(ExponentialRetryOptions, block) @_exponential_retry = end # Retrieves the runtime options for this activity. # # @return [Hash] # A hash containing the runtime option names and their current values. # def = self. [:task_list, :version, :_exponential_retry, :prefix_name, :return_on_start, :manual_completion, :data_converter].each do |attribute| .merge!(attribute => self.send(attribute)) if self.send(attribute) end end # Retrieves the default options for this activity. # # @return [Hash] # A hash containing the default option names and their current values. # # The options retrieved are: # # * :default_task_heartbeat_timeout # * :default_task_schedule_to_close_timeout # * :default_task_schedule_to_start_timeout # * :default_task_start_to_close_timeout # def ([:default_task_heartbeat_timeout, :default_task_schedule_to_close_timeout, :default_task_schedule_to_start_timeout, :default_task_start_to_close_timeout]) end end |
#default_task_schedule_to_close_timeout ⇒ Object
The optional default maximum duration, specified when registering the activity type, for tasks of this activity type. You can override this default when scheduling a task through the ‘ScheduleActivityTask` decision.
The valid values are integers greater than or equal to zero, or the string “NONE”. An integer value can be used to specify the duration in seconds while “NONE” is be used to specify unlimited duration.
569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 |
# File 'lib/aws/decider/options.rb', line 569 class ActivityOptions < Options class << self attr_reader :default_options, :runtime_options end properties(:default_task_heartbeat_timeout, :default_task_list, :default_task_schedule_to_close_timeout, :default_task_schedule_to_start_timeout, :default_task_start_to_close_timeout, :heartbeat_timeout, :task_list, :schedule_to_close_timeout, :schedule_to_start_timeout, :start_to_close_timeout, :version, :input) property(:manual_completion, [lambda {|x| x == true}]) property(:data_converter, []) default_classes << ActivityDefaults.new # Gets the activity prefix name. # # @return [String] # The activity name. # def activity_name @prefix_name end # Sets the activity prefix name. # # @param [String] value # The activity name to set. # def activity_name=(value) @prefix_name = value end # Creates a new set of `ActivityOptions`. # # @param [Hash] default_options # A set of `ActivityOptions` to use as the default values. # # @option default_options [Integer] :heartbeat_timeout # The optional default maximum time, specified when registering the # activity type, before which a worker processing a task must report # progress by calling `RecordActivityTaskHeartbeat`. # # You can override this default when scheduling a task through the # `ScheduleActivityTask` decision. If the activity worker subsequently # attempts to record a heartbeat or returns a result, the activity # worker receives an UnknownResource fault. In this case, Amazon SWF no # longer considers the activity task to be valid; the activity worker # should clean up the activity task. # # @option default_options [Integer] :schedule_to_close_timeout # The optional default maximum duration, specified when registering the # activity type, for tasks of this activity type. # # You can override this default when scheduling a task through the # `ScheduleActivityTask` decision. # # @option default_options [Integer] :schedule_to_start_timeout # The optional default maximum duration, specified when registering the # activity type, that a task of an activity type can wait before being # assigned to a worker. # # You can override this default when scheduling a task through the # `ScheduleActivityTask` decision. # # @option default_options [Integer] :start_to_close_timeout # The optional default maximum duration for tasks of an activity type # specified when registering the activity type. # # You can override this default when scheduling a task through the # `ScheduleActivityTask` decision. # # @option default_options [Array] :task_list # The optional default task list specified for this activity type at # registration. This default task list is used if a task list is not # provided when a task is scheduled through the ScheduleActivityTask # decision. # # You can override this default when scheduling a task through the # `ScheduleActivityTask` decision. # # @option default_options [String] :version # The version of this activity. If you change any other options on the # activity, you must also change the version. # # @param [true, false] use_defaults # Set to `true` to use the pre-defined {ActivityDefaults}. # def initialize(={}, use_defaults=false) if .keys.include? :exponential_retry @_exponential_retry = ExponentialRetryOptions.new([:exponential_retry]) end super(, use_defaults) end # Retrieves the runtime options for this activity. The runtime options returned are: # # * :heartbeat_timeout # * :task_list # * :schedule_to_close_timeout # * :schedule_to_start_timeout # * :start_to_close_timeout # # For a description of each of these options, see {#initialize}. # # @return [Hash] # The runtime option names and their current values. # def result = ([:heartbeat_timeout, :task_list, :schedule_to_close_timeout, :schedule_to_start_timeout, :start_to_close_timeout]) = ([:default_task_heartbeat_timeout, :default_task_schedule_to_close_timeout, :default_task_schedule_to_start_timeout, :default_task_start_to_close_timeout]) default_option_keys, default_option_values = .keys, .values default_option_keys.map! { |option| option.to_s.gsub(/default_task_/, "").to_sym } default_hash = Hash[default_option_keys.zip(default_option_values)] default_hash.merge(result) end property(:_exponential_retry, []) # Retries the supplied block with exponential retry logic. # # @param [Hash] block # A hash of {ExponentialRetryOptions}. # def exponential_retry(&block) = Utilities::(ExponentialRetryOptions, block) @_exponential_retry = end # Retrieves the runtime options for this activity. # # @return [Hash] # A hash containing the runtime option names and their current values. # def = self. [:task_list, :version, :_exponential_retry, :prefix_name, :return_on_start, :manual_completion, :data_converter].each do |attribute| .merge!(attribute => self.send(attribute)) if self.send(attribute) end end # Retrieves the default options for this activity. # # @return [Hash] # A hash containing the default option names and their current values. # # The options retrieved are: # # * :default_task_heartbeat_timeout # * :default_task_schedule_to_close_timeout # * :default_task_schedule_to_start_timeout # * :default_task_start_to_close_timeout # def ([:default_task_heartbeat_timeout, :default_task_schedule_to_close_timeout, :default_task_schedule_to_start_timeout, :default_task_start_to_close_timeout]) end end |
#default_task_schedule_to_start_timeout ⇒ Object
The optional default maximum duration, specified when registering the activity type, that a task of an activity type can wait before being assigned to a worker. You can override this default when scheduling a task through the ‘ScheduleActivityTask` decision.
569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 |
# File 'lib/aws/decider/options.rb', line 569 class ActivityOptions < Options class << self attr_reader :default_options, :runtime_options end properties(:default_task_heartbeat_timeout, :default_task_list, :default_task_schedule_to_close_timeout, :default_task_schedule_to_start_timeout, :default_task_start_to_close_timeout, :heartbeat_timeout, :task_list, :schedule_to_close_timeout, :schedule_to_start_timeout, :start_to_close_timeout, :version, :input) property(:manual_completion, [lambda {|x| x == true}]) property(:data_converter, []) default_classes << ActivityDefaults.new # Gets the activity prefix name. # # @return [String] # The activity name. # def activity_name @prefix_name end # Sets the activity prefix name. # # @param [String] value # The activity name to set. # def activity_name=(value) @prefix_name = value end # Creates a new set of `ActivityOptions`. # # @param [Hash] default_options # A set of `ActivityOptions` to use as the default values. # # @option default_options [Integer] :heartbeat_timeout # The optional default maximum time, specified when registering the # activity type, before which a worker processing a task must report # progress by calling `RecordActivityTaskHeartbeat`. # # You can override this default when scheduling a task through the # `ScheduleActivityTask` decision. If the activity worker subsequently # attempts to record a heartbeat or returns a result, the activity # worker receives an UnknownResource fault. In this case, Amazon SWF no # longer considers the activity task to be valid; the activity worker # should clean up the activity task. # # @option default_options [Integer] :schedule_to_close_timeout # The optional default maximum duration, specified when registering the # activity type, for tasks of this activity type. # # You can override this default when scheduling a task through the # `ScheduleActivityTask` decision. # # @option default_options [Integer] :schedule_to_start_timeout # The optional default maximum duration, specified when registering the # activity type, that a task of an activity type can wait before being # assigned to a worker. # # You can override this default when scheduling a task through the # `ScheduleActivityTask` decision. # # @option default_options [Integer] :start_to_close_timeout # The optional default maximum duration for tasks of an activity type # specified when registering the activity type. # # You can override this default when scheduling a task through the # `ScheduleActivityTask` decision. # # @option default_options [Array] :task_list # The optional default task list specified for this activity type at # registration. This default task list is used if a task list is not # provided when a task is scheduled through the ScheduleActivityTask # decision. # # You can override this default when scheduling a task through the # `ScheduleActivityTask` decision. # # @option default_options [String] :version # The version of this activity. If you change any other options on the # activity, you must also change the version. # # @param [true, false] use_defaults # Set to `true` to use the pre-defined {ActivityDefaults}. # def initialize(={}, use_defaults=false) if .keys.include? :exponential_retry @_exponential_retry = ExponentialRetryOptions.new([:exponential_retry]) end super(, use_defaults) end # Retrieves the runtime options for this activity. The runtime options returned are: # # * :heartbeat_timeout # * :task_list # * :schedule_to_close_timeout # * :schedule_to_start_timeout # * :start_to_close_timeout # # For a description of each of these options, see {#initialize}. # # @return [Hash] # The runtime option names and their current values. # def result = ([:heartbeat_timeout, :task_list, :schedule_to_close_timeout, :schedule_to_start_timeout, :start_to_close_timeout]) = ([:default_task_heartbeat_timeout, :default_task_schedule_to_close_timeout, :default_task_schedule_to_start_timeout, :default_task_start_to_close_timeout]) default_option_keys, default_option_values = .keys, .values default_option_keys.map! { |option| option.to_s.gsub(/default_task_/, "").to_sym } default_hash = Hash[default_option_keys.zip(default_option_values)] default_hash.merge(result) end property(:_exponential_retry, []) # Retries the supplied block with exponential retry logic. # # @param [Hash] block # A hash of {ExponentialRetryOptions}. # def exponential_retry(&block) = Utilities::(ExponentialRetryOptions, block) @_exponential_retry = end # Retrieves the runtime options for this activity. # # @return [Hash] # A hash containing the runtime option names and their current values. # def = self. [:task_list, :version, :_exponential_retry, :prefix_name, :return_on_start, :manual_completion, :data_converter].each do |attribute| .merge!(attribute => self.send(attribute)) if self.send(attribute) end end # Retrieves the default options for this activity. # # @return [Hash] # A hash containing the default option names and their current values. # # The options retrieved are: # # * :default_task_heartbeat_timeout # * :default_task_schedule_to_close_timeout # * :default_task_schedule_to_start_timeout # * :default_task_start_to_close_timeout # def ([:default_task_heartbeat_timeout, :default_task_schedule_to_close_timeout, :default_task_schedule_to_start_timeout, :default_task_start_to_close_timeout]) end end |
#default_task_start_to_close_timeout ⇒ Object
The optional default maximum duration for tasks of an activity type specified when registering the activity type. You can override this default when scheduling a task through the ‘ScheduleActivityTask` decision.
569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 |
# File 'lib/aws/decider/options.rb', line 569 class ActivityOptions < Options class << self attr_reader :default_options, :runtime_options end properties(:default_task_heartbeat_timeout, :default_task_list, :default_task_schedule_to_close_timeout, :default_task_schedule_to_start_timeout, :default_task_start_to_close_timeout, :heartbeat_timeout, :task_list, :schedule_to_close_timeout, :schedule_to_start_timeout, :start_to_close_timeout, :version, :input) property(:manual_completion, [lambda {|x| x == true}]) property(:data_converter, []) default_classes << ActivityDefaults.new # Gets the activity prefix name. # # @return [String] # The activity name. # def activity_name @prefix_name end # Sets the activity prefix name. # # @param [String] value # The activity name to set. # def activity_name=(value) @prefix_name = value end # Creates a new set of `ActivityOptions`. # # @param [Hash] default_options # A set of `ActivityOptions` to use as the default values. # # @option default_options [Integer] :heartbeat_timeout # The optional default maximum time, specified when registering the # activity type, before which a worker processing a task must report # progress by calling `RecordActivityTaskHeartbeat`. # # You can override this default when scheduling a task through the # `ScheduleActivityTask` decision. If the activity worker subsequently # attempts to record a heartbeat or returns a result, the activity # worker receives an UnknownResource fault. In this case, Amazon SWF no # longer considers the activity task to be valid; the activity worker # should clean up the activity task. # # @option default_options [Integer] :schedule_to_close_timeout # The optional default maximum duration, specified when registering the # activity type, for tasks of this activity type. # # You can override this default when scheduling a task through the # `ScheduleActivityTask` decision. # # @option default_options [Integer] :schedule_to_start_timeout # The optional default maximum duration, specified when registering the # activity type, that a task of an activity type can wait before being # assigned to a worker. # # You can override this default when scheduling a task through the # `ScheduleActivityTask` decision. # # @option default_options [Integer] :start_to_close_timeout # The optional default maximum duration for tasks of an activity type # specified when registering the activity type. # # You can override this default when scheduling a task through the # `ScheduleActivityTask` decision. # # @option default_options [Array] :task_list # The optional default task list specified for this activity type at # registration. This default task list is used if a task list is not # provided when a task is scheduled through the ScheduleActivityTask # decision. # # You can override this default when scheduling a task through the # `ScheduleActivityTask` decision. # # @option default_options [String] :version # The version of this activity. If you change any other options on the # activity, you must also change the version. # # @param [true, false] use_defaults # Set to `true` to use the pre-defined {ActivityDefaults}. # def initialize(={}, use_defaults=false) if .keys.include? :exponential_retry @_exponential_retry = ExponentialRetryOptions.new([:exponential_retry]) end super(, use_defaults) end # Retrieves the runtime options for this activity. The runtime options returned are: # # * :heartbeat_timeout # * :task_list # * :schedule_to_close_timeout # * :schedule_to_start_timeout # * :start_to_close_timeout # # For a description of each of these options, see {#initialize}. # # @return [Hash] # The runtime option names and their current values. # def result = ([:heartbeat_timeout, :task_list, :schedule_to_close_timeout, :schedule_to_start_timeout, :start_to_close_timeout]) = ([:default_task_heartbeat_timeout, :default_task_schedule_to_close_timeout, :default_task_schedule_to_start_timeout, :default_task_start_to_close_timeout]) default_option_keys, default_option_values = .keys, .values default_option_keys.map! { |option| option.to_s.gsub(/default_task_/, "").to_sym } default_hash = Hash[default_option_keys.zip(default_option_values)] default_hash.merge(result) end property(:_exponential_retry, []) # Retries the supplied block with exponential retry logic. # # @param [Hash] block # A hash of {ExponentialRetryOptions}. # def exponential_retry(&block) = Utilities::(ExponentialRetryOptions, block) @_exponential_retry = end # Retrieves the runtime options for this activity. # # @return [Hash] # A hash containing the runtime option names and their current values. # def = self. [:task_list, :version, :_exponential_retry, :prefix_name, :return_on_start, :manual_completion, :data_converter].each do |attribute| .merge!(attribute => self.send(attribute)) if self.send(attribute) end end # Retrieves the default options for this activity. # # @return [Hash] # A hash containing the default option names and their current values. # # The options retrieved are: # # * :default_task_heartbeat_timeout # * :default_task_schedule_to_close_timeout # * :default_task_schedule_to_start_timeout # * :default_task_start_to_close_timeout # def ([:default_task_heartbeat_timeout, :default_task_schedule_to_close_timeout, :default_task_schedule_to_start_timeout, :default_task_start_to_close_timeout]) end end |
Instance Method Details
#activity_name ⇒ String
Gets the activity prefix name.
585 586 587 |
# File 'lib/aws/decider/options.rb', line 585 def activity_name @prefix_name end |
#activity_name=(value) ⇒ Object
Sets the activity prefix name.
594 595 596 |
# File 'lib/aws/decider/options.rb', line 594 def activity_name=(value) @prefix_name = value end |
#exponential_retry(&block) ⇒ Object
Retries the supplied block with exponential retry logic.
689 690 691 692 |
# File 'lib/aws/decider/options.rb', line 689 def exponential_retry(&block) = Utilities::(ExponentialRetryOptions, block) @_exponential_retry = end |
#get_default_options ⇒ Hash
Retrieves the default options for this activity.
719 720 721 |
# File 'lib/aws/decider/options.rb', line 719 def ([:default_task_heartbeat_timeout, :default_task_schedule_to_close_timeout, :default_task_schedule_to_start_timeout, :default_task_start_to_close_timeout]) end |
#get_full_options ⇒ Hash
Retrieves the runtime options for this activity.
699 700 701 702 703 704 705 |
# File 'lib/aws/decider/options.rb', line 699 def = self. [:task_list, :version, :_exponential_retry, :prefix_name, :return_on_start, :manual_completion, :data_converter].each do |attribute| .merge!(attribute => self.send(attribute)) if self.send(attribute) end end |
#get_runtime_options ⇒ Hash
Retrieves the runtime options for this activity. The runtime options returned are:
-
:heartbeat_timeout
-
:task_list
-
:schedule_to_close_timeout
-
:schedule_to_start_timeout
-
:start_to_close_timeout
For a description of each of these options, see #initialize.
673 674 675 676 677 678 679 680 |
# File 'lib/aws/decider/options.rb', line 673 def result = ([:heartbeat_timeout, :task_list, :schedule_to_close_timeout, :schedule_to_start_timeout, :start_to_close_timeout]) = ([:default_task_heartbeat_timeout, :default_task_schedule_to_close_timeout, :default_task_schedule_to_start_timeout, :default_task_start_to_close_timeout]) default_option_keys, default_option_values = .keys, .values default_option_keys.map! { |option| option.to_s.gsub(/default_task_/, "").to_sym } default_hash = Hash[default_option_keys.zip(default_option_values)] default_hash.merge(result) end |