ntswf 2.0.9 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/README.md +1 -1
  2. data/lib/ntswf/base.rb +14 -14
  3. data/lib/ntswf/client.rb +1 -1
  4. metadata +2 -2
data/README.md CHANGED
@@ -48,4 +48,4 @@ See {Ntswf::Utils}
48
48
 
49
49
  License
50
50
  -------
51
- [LPGL-3.0](http://www.gnu.org/licenses/lgpl-3.0.html)
51
+ [LGPL-3.0](http://www.gnu.org/licenses/lgpl-3.0.html)
data/lib/ntswf/base.rb CHANGED
@@ -16,17 +16,17 @@ module Ntswf
16
16
  # (see {Client#start_execution}'s *:execution_id* for allowed values)
17
17
  # @option config [Numeric] :execution_version
18
18
  # Value allowing clients to reject future execution versions
19
+ # @option config [String] :isolation_file
20
+ # Development/test option.
21
+ # A random ID is stored at the given path, and prepended to task list names and execution IDs.
19
22
  # @option config [String] :pidfile
20
23
  # A path receiving the current PID for looping methods. Causes exit, if
21
24
  # overwritten by another process. See {Worker#in_subprocess}
22
- # @option config [Numeric] :subprocess_retries (0) see {Worker#in_subprocess}
23
25
  # @option config [String] :secret_access_key
24
26
  # AWS credential (deprecated, should use swf option)
27
+ # @option config [Numeric] :subprocess_retries (0) see {Worker#in_subprocess}
25
28
  # @option config [AWS::SimpleWorkflow] :swf
26
29
  # AWS simple workflow object (created e.g. with AWS::SimpleWorkflow.new)
27
- # @option config [String] :task_list_suffix_file
28
- # Development option.
29
- # A random ID is stored at the given path, and appended to all task list names.
30
30
  # @option config [String] :unit This worker/client's activity task list key
31
31
  # @raise [Errors::InvalidArgument] If a task list name is invalid
32
32
  def configure(config)
@@ -54,13 +54,17 @@ module Ntswf
54
54
  end
55
55
 
56
56
  def workflow_name
57
- "#{execution_id_prefix}-workflow"
57
+ "master-workflow"
58
58
  end
59
59
 
60
60
  def workflow_version
61
61
  "v1"
62
62
  end
63
63
 
64
+ def activity_name
65
+ "master-activity"
66
+ end
67
+
64
68
  def domain
65
69
  @domain ||= swf.domains[@config.domain]
66
70
  end
@@ -79,7 +83,7 @@ module Ntswf
79
83
  end
80
84
 
81
85
  def execution_id_prefix
82
- (@config.execution_id_prefix || default_unit).to_s
86
+ "#{isolation_id}#{@config.execution_id_prefix || default_unit}"
83
87
  end
84
88
 
85
89
  def execution_version
@@ -113,10 +117,6 @@ module Ntswf
113
117
 
114
118
  protected
115
119
 
116
- def activity_name
117
- "#{execution_id_prefix}-activity"
118
- end
119
-
120
120
  def announce(s)
121
121
  $0 = s
122
122
  log(s)
@@ -151,14 +151,14 @@ module Ntswf
151
151
 
152
152
  def autocomplete(value, fallback)
153
153
  value = fallback unless value.kind_of? String
154
- "#{value}#{task_list_suffix}"
154
+ "#{isolation_id}#{value}"
155
155
  end
156
156
 
157
- def task_list_suffix
158
- file = @config.task_list_suffix_file
157
+ def isolation_id
158
+ file = @config.isolation_file || @config.task_list_suffix_file
159
159
  return "" unless file
160
160
  File.write(file, SecureRandom.hex(9)) unless File.exist?(file)
161
- @suffix ||= File.read(file)
161
+ @isolation_id ||= File.read(file)
162
162
  end
163
163
  end
164
164
  end
data/lib/ntswf/client.rb CHANGED
@@ -18,7 +18,7 @@ module Ntswf
18
18
  # new executions, even in case of failure
19
19
  # @option options [String] :name Identifies the kind of task for the executing unit
20
20
  # @option options [Hash] :params Custom task parameters passed on to the executing unit
21
- # @option options [String] :tag_list
21
+ # @option options [Array<String>] :tag_list
22
22
  # Additional strings that will be added to to the tag list of the workflow execution.
23
23
  # @option options [String] :unit
24
24
  # The executing unit's key, a corresponding activity task list must be configured
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ntswf
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.9
4
+ version: 2.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-06-23 00:00:00.000000000 Z
12
+ date: 2014-07-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk