simplerubysteps 0.0.11 → 0.0.13
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.
- checksums.yaml +4 -4
- data/lib/simplerubysteps/dsl.rb +12 -0
- data/lib/simplerubysteps/model.rb +37 -0
- data/lib/simplerubysteps/tool.rb +1 -0
- data/lib/simplerubysteps/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4634df51423d09b913d7580a4c2827a4a5a052ffaa5784df7bde18b1e61a729
|
4
|
+
data.tar.gz: 9410dcd916fb7ef55cb6be079c71f0f9f2db9d60d0a3c11984eac9b27213c01d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05c5515b4308c4697760ceb7b2f64e998ae97f97f46898696dda3a6bb7cc6ae4f29c9552ccb9e217fde5f3f35a424ad768f179c76722c160d28116fa47b96dbf
|
7
|
+
data.tar.gz: d530940f3ba655761ff90586f1ccccb126279966211fea319b7dcbd0730b017dd17c22556d3f08e0ba6735fa8e545d1b527935d963a189a6f4ac88e5ef5f102b
|
data/lib/simplerubysteps/dsl.rb
CHANGED
@@ -90,6 +90,18 @@ module Simplerubysteps
|
|
90
90
|
$tasks.last.next = state
|
91
91
|
end
|
92
92
|
|
93
|
+
def error_retry(interval, max, backoff, error = "States.ALL")
|
94
|
+
$tasks.last.error_retry(interval, max, backoff)
|
95
|
+
end
|
96
|
+
|
97
|
+
def task_timeout(secs, state = nil)
|
98
|
+
$tasks.last.task_timeout secs, state
|
99
|
+
end
|
100
|
+
|
101
|
+
def error_catch(state, error = "States.ALL")
|
102
|
+
$tasks.last.error_catch state
|
103
|
+
end
|
104
|
+
|
93
105
|
def transition_to(state, &condition_block)
|
94
106
|
choice = $tasks.last.implicit_choice
|
95
107
|
|
@@ -94,6 +94,43 @@ module Simplerubysteps
|
|
94
94
|
dict[:End] = true unless dict[:Next]
|
95
95
|
dict
|
96
96
|
end
|
97
|
+
|
98
|
+
def error_retry(interval, max, backoff, error = "States.ALL") # FIXME move to new baseclass for Task and Callback
|
99
|
+
data = {
|
100
|
+
:ErrorEquals => [error],
|
101
|
+
:IntervalSeconds => interval,
|
102
|
+
:BackoffRate => backoff,
|
103
|
+
:MaxAttempts => max,
|
104
|
+
}
|
105
|
+
|
106
|
+
unless @dict[:Retry]
|
107
|
+
@dict[:Retry] = [data]
|
108
|
+
else
|
109
|
+
@dict[:Retry].push data
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
def task_timeout(secs, state = nil) # FIXME move to new baseclass for Task and Callback
|
114
|
+
@dict[:TimeoutSeconds] = secs
|
115
|
+
|
116
|
+
if state
|
117
|
+
error_catch state, "States.Timeout"
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
def error_catch(state, error = "States.ALL") # FIXME move to new baseclass for Task and Callback
|
122
|
+
data = {
|
123
|
+
:ErrorEquals => [error],
|
124
|
+
:Next => (state.is_a? Symbol) ? state : state.name,
|
125
|
+
:ResultPath => "$.error",
|
126
|
+
}
|
127
|
+
|
128
|
+
unless @dict[:Catch]
|
129
|
+
@dict[:Catch] = [data]
|
130
|
+
else
|
131
|
+
@dict[:Catch].push data
|
132
|
+
end
|
133
|
+
end
|
97
134
|
end
|
98
135
|
|
99
136
|
class Parallel < State
|
data/lib/simplerubysteps/tool.rb
CHANGED
@@ -589,6 +589,7 @@ module Simplerubysteps
|
|
589
589
|
opts.separator " destroy Delete Step Functions State Machine"
|
590
590
|
opts.separator " log Continuously prints Lambda function log output"
|
591
591
|
opts.separator " start Start State Machine execution"
|
592
|
+
opts.separator " stack Display stack infos"
|
592
593
|
opts.separator " task-success Continue Start State Machine execution"
|
593
594
|
opts.separator ""
|
594
595
|
|