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
.
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.
To view or download the code for all of the AWS Flow Framework for Ruby recipes and samples, go to:
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.
To run the SplitMerge sample:
-
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
-
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
-
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 about the Amazon Simple Workflow service and the Amazon Flow Framework for Ruby, consult the following resources: