You are viewing documentation for version 1 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: AWS::SimpleWorkflow::ActivityTypeCollection

Inherits:
TypeCollection
  • Object
show all
Defined in:
lib/aws/simple_workflow/activity_type_collection.rb

Instance Method Summary collapse

Methods included from Core::Collection

#each, #each_batch, #enum, #first, #in_groups_of, #page

Instance Method Details

#register(name, version, options = {}) ⇒ Object Also known as: create

Registers a new activity type along with its configuration settings in the current domain.

Parameters:

  • name (String)

    The name of the activity type.

  • version (String)

    The version of the activity type. The activity type consists of the name and version, the combination of which must be unique within the domain.

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

Options Hash (options):

  • :default_task_heartbeat_timeout (Integer, :none) — default: nil

    The default maximum time before which a worker processing a task of this type must report progress. If the timeout is exceeded, the activity task is automatically timed out. If the worker subsequently attempts to record a heartbeat or returns a result, it will be ignored. This default can be overridden when scheduling an activity task.

    The value should be a number of seconds (integer) or the symbol :none (implying no timeout).

  • :default_task_list (String) — default: nil

    The default task list to use for scheduling tasks of this activity type. This default task list is used if a task list is not provided when a task is scheduled.

  • :default_task_priority (Integer) — default: nil

    Specifies the default task priority to use for scheduling tasks for this activity type. This default is used only if a task priority is not provided when a task is scheduled.

  • :default_task_schedule_to_close_timeout (Integer, :none) — default: nil

    The value should be a number of seconds (integer) or the symbol :none (implying no timeout).

  • :default_task_schedule_to_start_timeout (Integer, :none) — default: nil

    The default maximum duration that a task of this activity type can wait before being assigned to a worker. This default can be overridden when scheduling an activity task.

    The value should be a number of seconds (integer) or the symbol :none (implying no timeout).

  • :default_task_start_to_close_timeout (Integer, :none) — default: nil

    The default maximum duration that a worker can take to process tasks of this activity type (in the ISO 8601 format). This default can be overridden when scheduling an activity task.

    The value should be a number of seconds (integer) or the symbol :none (implying no timeout).

  • :description (String) — default: nil

    A textual description of the activity type.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/aws/simple_workflow/activity_type_collection.rb', line 73

def register name, version, options = {}

  options[:domain] = domain.name
  options[:name] = name
  options[:version] = version

  duration_opts(options,
    :default_task_heartbeat_timeout,
    :default_task_schedule_to_close_timeout,
    :default_task_schedule_to_start_timeout,
    :default_task_start_to_close_timeout)

  if priority = options[:default_task_priority]
    options[:default_task_priority] = priority.to_s
  end

  if task_list = options[:default_task_list]
    options[:default_task_list] = { :name => task_list.to_s }
  end

  client.register_activity_type(options)

  self[name, version]

end