Module: Ntswf

Defined in:
lib/ntswf.rb,
lib/ntswf/base.rb,
lib/ntswf/utils.rb,
lib/ntswf/client.rb,
lib/ntswf/errors.rb,
lib/ntswf/worker.rb,
lib/ntswf/instance.rb,
lib/ntswf/activity_worker.rb,
lib/ntswf/decision_worker.rb

Defined Under Namespace

Modules: ActivityWorker, Base, Client, DecisionWorker, Errors, Utils, Worker Classes: Instance

Constant Summary collapse

DEFAULT_MODULES =
%w(
  ActivityWorker
  Client
  DecisionWorker
  Utils
)
AUTOLOAD =
DEFAULT_MODULES + %w(
  Errors
  Instance
)

Class Method Summary collapse

Class Method Details

.create(*modules, config) ⇒ Object

Shortcut for creating an Instance

Examples:

Ntswf.create(:client, :activity_worker, unit: "my_worker")

Parameters:

  • modules (DEFAULT_MODULES)

    A list of module names to include

  • config (Hash)

    A configuration with the following keys:

Options Hash (config):

  • :access_key_id (String)

    AWS credential (deprecated, should use swf option)

  • :activity_task_lists (Hash)

    The task list names for activities as hash (see also :unit)

  • :decision_task_list (String)

    The task list name for decisions

  • :domain (String)

    The SWF domain name

  • :execution_id_prefix (String) — default: value of :unit

    Workflow ID prefix (see Ntswf::Client#start_execution‘s :execution_id for allowed values)

  • :execution_version (Numeric)

    Value allowing clients to reject future execution versions

  • :identity_suffix (String)

    When polling for a task, the suffix will be appended to the (default) identity (<hostname>:<pid>), delimited by a “:”. Allows to distinguish worker activity on different hosts with identical hostnames.

  • :isolation_file (String)

    Development/test option. A random ID is stored at the given path, and prepended to task list names and execution IDs.

  • :pidfile (String)

    A path receiving the current PID for looping methods. Causes exit, if overwritten by another process. See Ntswf::Worker#in_subprocess

  • :secret_access_key (String)

    AWS credential (deprecated, should use swf option)

  • :subprocess_retries (Numeric) — default: 0
  • :swf (AWS::SimpleWorkflow)

    AWS simple workflow object (created e.g. with AWS::SimpleWorkflow.new)

  • :unit (String)

    This worker/client’s activity task list key



9
10
11
# File 'lib/ntswf.rb', line 9

def self.create(*args)
  Ntswf::Instance.new(*args)
end