This repository was archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathutils.rb
More file actions
45 lines (38 loc) · 1.42 KB
/
utils.rb
File metadata and controls
45 lines (38 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Copyright 2014-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
require 'bundler/setup'
require 'aws/decider'
require 'logger'
# These are utilities that are common to all samples and recipes
module SharedUtils
def setup_domain(domain_name)
swf = AWS::SimpleWorkflow.new
domain = swf.domains[domain_name]
unless domain.exists?
swf.domains.create(domain_name, 10)
end
domain
end
def build_workflow_worker(domain, klass, task_list)
AWS::Flow::WorkflowWorker.new(domain.client, domain, task_list, klass)
end
def build_generic_activity_worker(domain, task_list)
AWS::Flow::ActivityWorker.new(domain.client, domain, task_list)
end
def build_activity_worker(domain, klass, task_list)
AWS::Flow::ActivityWorker.new(domain.client, domain, task_list, klass)
end
def build_workflow_client(domain, options_hash)
AWS::Flow::workflow_client(domain.client, domain) { options_hash }
end
end