Class: AWS::SimpleWorkflow::ActivityTypeCollection

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

Instance Attribute Summary

Attributes inherited from TypeCollection

#domain

Attributes included from Core::Model

#config

Instance Method Summary collapse

Methods inherited from TypeCollection

#[], #deprecated, #initialize, #named, #reverse_order

Methods included from Core::Collection::Limitable

#each_batch

Methods included from Core::Collection

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

Methods included from Core::Model

#client, #config_prefix, #initialize, #inspect

Constructor Details

This class inherits a constructor from AWS::SimpleWorkflow::TypeCollection

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_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.


68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/aws/simple_workflow/activity_type_collection.rb', line 68

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 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