-
Notifications
You must be signed in to change notification settings - Fork 10
Echo example
theburningmonk edited this page Feb 2, 2013
·
1 revision
open Amazon.SimpleWorkflow
open Amazon.SimpleWorkflow.Extensions
// simple echo function to echo the supplied string argument before returning it
let echo str = printfn "%s" str; str
// a workflow with only one activity, which echos the input given to the workflow execution
let echoWorkflow =
Workflow(domain = "theburningmonk.com", name = "echo",
description = "simple echo example",
version = "1")
++> Activity("echo", "echo input", echo,
taskHeartbeatTimeout = 60,
taskScheduleToStartTimeout = 10,
taskStartToCloseTimeout = 10,
taskScheduleToCloseTimeout = 20)
The ++> operator attaches an activity to the workflow. To start the workflow, call the Start method with an instance of AmazonSimpleWorkflowClient, the domain, workflow and activities will be registered as necessary and auto-generated decision and activity workers will be started too.
let awsKey = "PUT_YOUR_AWS_KEY_HERE"
let awsSecret = "PUT_YOUR_AWS_SECRET_HERE"
let client = new AmazonSimpleWorkflowClient(awsKey, awsSecret)
echoWorkflow.Start(client)