flor 0.9.2 → 0.9.3

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.
@@ -0,0 +1,54 @@
1
+ #--
2
+ # Copyright (c) 2015-2017, John Mettraux, jmettraux+flor@gmail.com
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ # of this software and associated documentation files (the "Software"), to deal
6
+ # in the Software without restriction, including without limitation the rights
7
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ # copies of the Software, and to permit persons to whom the Software is
9
+ # furnished to do so, subject to the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be included in
12
+ # all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ # THE SOFTWARE.
21
+ #
22
+ # Made in Japan.
23
+ #++
24
+
25
+ module Flor
26
+
27
+ class BasicTasker
28
+
29
+ attr_reader :ganger, :conf, :message
30
+
31
+ def initialize(ganger, conf, message)
32
+
33
+ @ganger = ganger
34
+ @conf = conf
35
+ @message = message
36
+ end
37
+
38
+ protected
39
+
40
+ def reply(force=false)
41
+
42
+ @ganger.reply(@message) if force || @ganger
43
+ end
44
+
45
+ def exid; @message['exid']; end
46
+ def nid; @message['nid']; end
47
+
48
+ def execution
49
+
50
+ @ganger.unit.execution(exid)
51
+ end
52
+ end
53
+ end
54
+
data/out.txt ADDED
@@ -0,0 +1,206 @@
1
+
2
+ 054400 satsuma 我 ~/w/sg (master) マ FLOR_DEBUG=dbg bxs spec/functional/cases/awm_activation_spec.rb:198
3
+
4
+ java 1.9.3
5
+ Run options: include {:locations=>{"./spec/functional/cases/awm_activation_spec.rb"=>[198]}}
6
+
7
+ Sg::Cases::AwmActivation
8
+ .reply
9
+ as OPS
10
+ +---
11
+ | {:vars=>{:launcher=>2002}, :payload=>{"client"=>{"rm"=>"2002", "codename"=>"brilliant-fire-4", "nationality"=>"Singapore", "domicile"=>"Singapore", "amount"=>1000000, "currency"=>"USD", "orientation"=>"Standard", "amountUsd"=>1000000, "amountString"=>"1,000,000", "amountUsdString"=>"1,000,000", "mandateId"=>"2002-201702050001"}, "objective"=>{"o"=>"b", "objective"=>"Build"}, "risk"=>{"profile"=>"Aggressive Growth", "level"=>4, "self"=>{"profile"=>"Aggressive Growth", "level"=>4}, "a"=>{"profile"=>"Aggressive Growth", "level"=>4}, "b"=>{"profile"=>"Aggressive Growth", "level"=>4}, "answers"=>["#raAggressiveGrowth", "#raPioGrowth", "#raWpLow", "#raCfNo", "#raPfz", "#raHl8", "#raReIncrease"], "mode"=>"normal"}, "strategy"=>{"name"=>"Conservative", "c"=>"c3", "i"=>3}, "agreement"=>{"allin"=>"1.10%", "discounted"=>"1.00%", "rate"=>"0%"}}, :fname=>"flor/lib/flows/iwm.asia.pfs/awm/awm_activation.flo", :colour=>true}
12
+ | # awm_activation.flo
13
+ | sequence
14
+ | create_mandate _
15
+ | ops 'assign container number'
16
+ | update_mandate status: 'numbered'
17
+ | pfs 'activate mandate'
18
+ | update_mandate status: 'active'
19
+ | email 'rm' 'awm mandate activated'
20
+ .
21
+ +---
22
+ | 0 sequence L4
23
+ | 0_0 create_mandate L6
24
+ | 0_0_0 _att L6
25
+ | 0_0_0_0 _ L6
26
+ | 0_1 ops L8
27
+ | 0_1_0 _att L8
28
+ | 0_1_0_0 _sqs assign container number L8
29
+ | 0_2 update_mandate L9
30
+ | 0_2_0 _att L9
31
+ | 0_2_0_0 status L9
32
+ | 0_2_0_1 _sqs numbered L9
33
+ | 0_3 pfs L11
34
+ | 0_3_0 _att L11
35
+ | 0_3_0_0 _sqs activate mandate L11
36
+ | 0_4 update_mandate L12
37
+ | 0_4_0 _att L12
38
+ | 0_4_0_0 status L12
39
+ | 0_4_0_1 _sqs active L12
40
+ | 0_5 email L14
41
+ | 0_5_0 _att L14
42
+ | 0_5_0_0 _sqs rm L14
43
+ | 0_5_1 _att L14
44
+ | 0_5_1_0 _sqs awm mandate activated L14
45
+ .
46
+ /--- run starts Flor::UnitExecutor 7816 iwm.asia.pfs.awm-u0-20170204.2056.kilodababi
47
+ | {:thread=>7818}
48
+ | {:counters=>{}, :nodes=>0, :size=>132}
49
+ 20:56:36.753 bi 0 exe [sequence L4] [[create_mandate,[[_att,[[_,[],6]],6]],6],[... m1s_ f.ret null vars:launcher
50
+ 20:56:36.784 bi 0_0 exe [task L6] [[_att,[[_sqs,create_mandate,6]],6],[_att,[... m2s1r1>1 from 0 f.ret null
51
+ 20:56:36.786 bi 0_0_0 exe [_att L6] [[_sqs,create_mandate,6]] m3s2r1>1 from 0_0 f.ret null
52
+ 20:56:36.791 bi 0_0_0_0 exe ended: [_sqs L6] create_mandate m4s3r1>1 from 0_0_0 f.ret create_mandate
53
+ 20:56:36.792 bi 0_0_0 rec ended: [_att L6] hp:_att m5s4r1>1 from 0_0_0_0 f.ret create_mandate
54
+ 20:56:36.793 bi 0_0 rec [task L6] hp:task m6s5r1>1 from 0_0_0 f.ret create_mandate
55
+ 20:56:36.794 bi 0_0_1 exe ended: [_att L6] [[_,[],6]] m7s6r1>1 from 0_0 f.ret create_mandate
56
+ 20:56:36.796 bi 0_0 rec [task L6] hp:task m8s7r1>1 from 0_0_1 f.ret create_mandate
57
+ 20:56:37.019 bi 0_0 tas [task L6] hp:task m9s8r1>1 from 0_0 f.ret create_mandate
58
+ | run ends Flor::UnitExecutor 7816 iwm.asia.pfs.awm-u0-20170204.2056.kilodababi
59
+ | {:took=>1.282}
60
+ | {:thread=>7818, :consumed=>9, :traps=>0}
61
+ | {:counters=>{"runs"=>1, "msgs"=>9, "omsgs"=>0}, :nodes=>2, :size=>861}
62
+ \--- .
63
+ /--- run starts Flor::UnitExecutor 7824 iwm.asia.pfs.awm-u0-20170204.2056.kilodababi
64
+ | {:thread=>7826}
65
+ | {:counters=>{}, :nodes=>0, :size=>132}
66
+ 20:56:38.037 bi 0_0 ret m1s_ f.ret create_mandate
67
+ 20:56:38.038 bi 0_0 rec m2s_r1>1 f.ret create_mandate
68
+ /=e092 =exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe
69
+ |=e092 + in Flor::UnitExecutor#do_run
70
+ |=e092 error: #<NoMethodError: undefined method `[]' for nil:NilClass>
71
+ |=e092 db: Sequel::JDBC::Database 321524886
72
+ |=e092 thread: t7826 #<Thread:0x3b42dc22 run>
73
+ |=e092 exe:
74
+ |=e092 exid: "iwm.asia.pfs.awm-u0-20170204.2056.kilodababi"
75
+ |=e092 counters: {"runs"=>1, "msgs"=>2, "omsgs"=>0}
76
+ |=e092 messages:
77
+ |=e092 []
78
+ |=e092 storage errored items/models:
79
+ |=e092 * {"exid"=>"iwm.asia.pfs.awm-u0-20170204.2056.kilodababi", "nodes"=>{}, "errors"=>[], "tasks"=>{}, "counters"=>{"runs"=>1, "msgs"=>2, "omsgs"=>0}, "start"=>"2017-02-04T20:56:36.736000Z", "size"=>132, "id"=>58}
80
+ |=e092 error: #<NoMethodError: undefined method `[]' for nil:NilClass>
81
+ |=e092 backtrace:
82
+ |=e092 /Users/jmettraux/w/sg/subrepos/flor/lib/flor/unit/storage.rb:156:in `put_execution'
83
+ |=e092 /Users/jmettraux/w/sg/subrepos/flor/lib/flor/unit/executor.rb:112:in `do_run'
84
+ |=e092 /Users/jmettraux/w/sg/subrepos/flor/lib/flor/unit/executor.rb:53:in `run'
85
+ \=e092 =exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe .
86
+
87
+
88
+
89
+
90
+ dump:
91
+
92
+ {:execution=>
93
+ {"exid"=>"iwm.asia.pfs.awm-u0-20170204.2056.kilodababi",
94
+ "nodes"=>{},
95
+ "errors"=>[],
96
+ "tasks"=>{},
97
+ "counters"=>{"runs"=>1, "msgs"=>2, "omsgs"=>0},
98
+ "start"=>"2017-02-04T20:56:36.736000Z",
99
+ "size"=>132,
100
+ "id"=>58},
101
+ :messages=>[],
102
+ :consumed=>
103
+ [{"point"=>"return",
104
+ "exid"=>"iwm.asia.pfs.awm-u0-20170204.2056.kilodababi",
105
+ "nid"=>"0_0",
106
+ "payload"=>
107
+ {"client"=>
108
+ {"rm"=>"2002",
109
+ "codename"=>"brilliant-fire-4",
110
+ "nationality"=>"Singapore",
111
+ "domicile"=>"Singapore",
112
+ "amount"=>1000000,
113
+ "currency"=>"USD",
114
+ "orientation"=>"Standard",
115
+ "amountUsd"=>1000000,
116
+ "amountString"=>"1,000,000",
117
+ "amountUsdString"=>"1,000,000",
118
+ "mandateId"=>"2002-201702050001"},
119
+ "objective"=>{"o"=>"b", "objective"=>"Build"},
120
+ "risk"=>
121
+ {"profile"=>"Aggressive Growth",
122
+ "level"=>4,
123
+ "self"=>{"profile"=>"Aggressive Growth", "level"=>4},
124
+ "a"=>{"profile"=>"Aggressive Growth", "level"=>4},
125
+ "b"=>{"profile"=>"Aggressive Growth", "level"=>4},
126
+ "answers"=>
127
+ ["#raAggressiveGrowth",
128
+ "#raPioGrowth",
129
+ "#raWpLow",
130
+ "#raCfNo",
131
+ "#raPfz",
132
+ "#raHl8",
133
+ "#raReIncrease"],
134
+ "mode"=>"normal"},
135
+ "strategy"=>{"name"=>"Conservative", "c"=>"c3", "i"=>3},
136
+ "agreement"=>{"allin"=>"1.10%", "discounted"=>"1.00%", "rate"=>"0%"},
137
+ "ret"=>"create_mandate"},
138
+ "tasker"=>"create_mandate",
139
+ "mid"=>144,
140
+ "m"=>1,
141
+ "pr"=>1,
142
+ "consumed"=>"2017-02-04T20:56:38.037000Z"},
143
+ {"point"=>"receive",
144
+ "exid"=>"iwm.asia.pfs.awm-u0-20170204.2056.kilodababi",
145
+ "nid"=>"0_0",
146
+ "payload"=>
147
+ {"client"=>
148
+ {"rm"=>"2002",
149
+ "codename"=>"brilliant-fire-4",
150
+ "nationality"=>"Singapore",
151
+ "domicile"=>"Singapore",
152
+ "amount"=>1000000,
153
+ "currency"=>"USD",
154
+ "orientation"=>"Standard",
155
+ "amountUsd"=>1000000,
156
+ "amountString"=>"1,000,000",
157
+ "amountUsdString"=>"1,000,000",
158
+ "mandateId"=>"2002-201702050001"},
159
+ "objective"=>{"o"=>"b", "objective"=>"Build"},
160
+ "risk"=>
161
+ {"profile"=>"Aggressive Growth",
162
+ "level"=>4,
163
+ "self"=>{"profile"=>"Aggressive Growth", "level"=>4},
164
+ "a"=>{"profile"=>"Aggressive Growth", "level"=>4},
165
+ "b"=>{"profile"=>"Aggressive Growth", "level"=>4},
166
+ "answers"=>
167
+ ["#raAggressiveGrowth",
168
+ "#raPioGrowth",
169
+ "#raWpLow",
170
+ "#raCfNo",
171
+ "#raPfz",
172
+ "#raHl8",
173
+ "#raReIncrease"],
174
+ "mode"=>"normal"},
175
+ "strategy"=>{"name"=>"Conservative", "c"=>"c3", "i"=>3},
176
+ "agreement"=>{"allin"=>"1.10%", "discounted"=>"1.00%", "rate"=>"0%"},
177
+ "ret"=>"create_mandate"},
178
+ "tasker"=>"create_mandate",
179
+ "er"=>1,
180
+ "m"=>2,
181
+ "pr"=>1,
182
+ "consumed"=>"2017-02-04T20:56:38.038000Z"}],
183
+ :traps=>[],
184
+ :exid=>"iwm.asia.pfs.awm-u0-20170204.2056.kilodababi",
185
+ :alive=>false,
186
+ :shutdown=>false,
187
+ :thread=>[7826, "#<Thread:0x3b42dc22>"]}
188
+ --------------------------------------------------------------------------------
189
+ /=e091 =exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe
190
+ |=e091 + in Flor::UnitExecutor#do_run
191
+ |=e091 error: #<NoMethodError: undefined method `[]' for nil:NilClass>
192
+ |=e091 db: Sequel::JDBC::Database 321524886
193
+ |=e091 thread: t7826 #<Thread:0x3b42dc22 run>
194
+ |=e091 exe:
195
+ |=e091 exid: "iwm.asia.pfs.awm-u0-20170204.2056.kilodababi"
196
+ |=e091 counters: {"runs"=>1, "msgs"=>2, "omsgs"=>0}
197
+ |=e091 messages:
198
+ |=e091 []
199
+ |=e091 storage errored items/models:
200
+ |=e091 * {"exid"=>"iwm.asia.pfs.awm-u0-20170204.2056.kilodababi", "nodes"=>{}, "errors"=>[], "tasks"=>{}, "counters"=>{"runs"=>1, "msgs"=>2, "omsgs"=>0}, "start"=>"2017-02-04T20:56:36.736000Z", "size"=>132, "id"=>58}
201
+ |=e091 error: #<NoMethodError: undefined method `[]' for nil:NilClass>
202
+ |=e091 backtrace:
203
+ |=e091 /Users/jmettraux/w/sg/subrepos/flor/lib/flor/unit/storage.rb:156:in `put_execution'
204
+ |=e091 /Users/jmettraux/w/sg/subrepos/flor/lib/flor/unit/executor.rb:112:in `do_run'
205
+ |=e091 /Users/jmettraux/w/sg/subrepos/flor/lib/flor/unit/executor.rb:53:in `run'
206
+ \=e091 =exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe=exe .
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
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: 2017-02-03 00:00:00.000000000 Z
12
+ date: 2017-02-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: munemo
@@ -156,6 +156,7 @@ files:
156
156
  - lib/flor/tools/env.rb
157
157
  - lib/flor/tools/repl.rb
158
158
  - lib/flor/unit/executor.rb
159
+ - lib/flor/unit/ganger.rb
159
160
  - lib/flor/unit/hooker.rb
160
161
  - lib/flor/unit/journal.rb
161
162
  - lib/flor/unit/loader.rb
@@ -168,7 +169,7 @@ files:
168
169
  - lib/flor/unit/models.rb
169
170
  - lib/flor/unit/scheduler.rb
170
171
  - lib/flor/unit/storage.rb
171
- - lib/flor/unit/tasker.rb
172
+ - lib/flor/unit/taskers.rb
172
173
  - lib/flor/unit/waiter.rb
173
174
  - lib/flor/unit/wlist.rb
174
175
  - lib/flor/unit.rb
@@ -177,6 +178,7 @@ files:
177
178
  - fail.txt
178
179
  - intercepted.txt
179
180
  - LICENSE.txt
181
+ - out.txt
180
182
  - CHANGELOG.md
181
183
  - README.md
182
184
  homepage: http://github.com/floraison