Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Files

Latest commit

author
Przemysław Dąbek
Apr 3, 2017
15cde4c · Apr 3, 2017

History

History

split_merge

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Apr 3, 2017
Mar 3, 2015
Apr 20, 2016

AWS Flow Framework for Ruby: SplitMerge Sample Application

The SplitMerge sample demonstrates a parallel split followed by a simple merge workflow pattern. It spawns a number of worker activities which are then merged using wait_for_all.

Prerequisites

The AWS Flow Framework for Ruby is required, which can be obtained and installed using the information here:

If you already have Ruby and RubyGems installed, you can install the framework by opening a terminal window and typing:

gem install aws-flow

For more information about setting up the AWS Flow Framework for Ruby, see Installing the AWS Flow Framework for Ruby in the AWS Flow Framework for Ruby Developer Guide.

Download the sample code

To view or download the code for all of the AWS Flow Framework for Ruby recipes and samples, go to:

Configure the sample

This sample requires a little bit of configuration. Open the splitmerge_utils.rb file and modify the following line:

BUCKET = "swf-private-beta-samples"

Replace the value swf-private-beta-samples with an S3 bucket name associated with your AWS account. For more information about how to create S3 buckets, see the Amazon S3 Getting Started Guide.

Run the Sample

To run the SplitMerge sample:

  1. Open three separate terminal windows and, in each one, change to the lib directory in the location where you cloned or unarchived the sample code. For example:

    cd ~/Downloads/aws-flow-ruby-samples/samples/split_merge/lib
    
  2. In each command-line (terminal) window, execute the following commands, substituting your AWS Access keys for the example values.

    On Linux, OS X or Unix:

    export AWS_ACCESS_KEY_ID='your-access-key'
    export AWS_SECRET_ACCESS_KEY='your-secret-key'
    export AWS_REGION='your-aws-region'
    

    On Windows:

    set AWS_ACCESS_KEY_ID=your-access-key
    set AWS_SECRET_ACCESS_KEY=your-secret-key
    set AWS_REGION=your-aws-region
    
  3. Execute the following commands, one in each of the terminal windows:

    ruby splitmerge_activity.rb
    ruby splitmerge_workflow.rb
    ruby splitmerge_workflow_starter.rb
    

For More Information

For more information about the Amazon Simple Workflow service and the Amazon Flow Framework for Ruby, consult the following resources: