Module: AWS::Flow::Runner

Includes:
AWS::Flow
Defined in:
aws-flow-ruby/aws-flow/lib/aws/runner.rb

Overview

The Runner is a command-line utility that can spawn workflow and activity workers according to a specification that you provide in a JSON configuration file. It is available beginning with version 1.3.0 of the AWS Flow Framework for Ruby.

Invoking the Runner

It is invoked like so:

aws-flow-ruby -f runspec.json

Where runspec.json represents a local JSON file that specifies how to run your activities and workflows.

The Runner Specification File

The runner is configured by passing it a JSON-formatted configuration file. Here is a minimal example, providing only the required fields:

{
  "domain": { "name": "ExampleDomain" },
  "workflow_workers": [
    {
      "task_list": "example_workflow_tasklist"
    }
  ],
  "activity_workers": [
    {
      "task_list": "example_activity_tasklist"
    }
  ],
}

For More Information

For a complete description of the runner's specification, with examples of both configuring and using the runner, see The Runner in the AWS Flow Framework for Ruby Developer Guide.

Class Method Summary (collapse)

Methods included from AWS::Flow

decision_context, on_windows?, start, start_workflow, version, with_retry, #workflow_client

Class Method Details

+ (Object) run(worker_spec)

Invoked from code. This is a helper method that can be used to start the runner from code. This is especially helpful for debugging purposes.

worker_spec: Hash representation of the json worker spec



405
406
407
408
409
410
411
412
# File 'aws-flow-ruby/aws-flow/lib/aws/runner.rb', line 405

def self.run(worker_spec)
  workers = start_workers(worker_spec)
  setup_signal_handling(workers)

  # Hang there until killed: this process is used to relay signals to
  # children to support and facilitate an orderly shutdown.
  wait_for_child_processes(workers)
end