rsmp 0.11.4 → 0.11.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3632282c6b535bc3d2355f4f572bea3179729dc89b3afa34f92aa57853e6e437
4
- data.tar.gz: e64e7695d2b41f5f6c297b0c1a56c72ce8fb0bc5415f42e6026af5a8ae826dbe
3
+ metadata.gz: 85f5c9ffaa15773f1f5e6722bd93fcf8ecff524166859bafec85e6871a285330
4
+ data.tar.gz: 90f8edb63fb20d324885c9e9b15c5bde49bcbdc80086fa48c36fd4c78b183475
5
5
  SHA512:
6
- metadata.gz: c543a2e50e6894edeb003432050fae0b1ee9f8cc14814139156cf861ccc02d32b48b3fbec513723d610d453626330ea471bbdf0e937ccf28a80bb38d8ef3310a
7
- data.tar.gz: 6d2e410152c264582d89efe5f08fe2f314d5848e4bc00bcc37d4e017e0cf85c17955f3604297a7972cdbfb55899105994a12206e996b92368fe53d826e02c0ab
6
+ metadata.gz: 01c22ef28ddbaedcf45d7c24518d1cf9ffe190f434c0e8e0e07a9e7d12f6333ea5ccc16f2532502755d1efa6619e9a2c7d73e462aeed9ea75f93deb55e4cb0ab
7
+ data.tar.gz: ebca1461398deacd9ff211e0bbc24c4586e286d46806c8b62718a36eaf41b5b53c2cef5a6f1882b81d4009778172a0173bf390812478e47bca86927465bde179
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rsmp (0.11.4)
4
+ rsmp (0.11.7)
5
5
  async (~> 1.29.1)
6
6
  async-io (~> 1.32.2)
7
7
  colorize (~> 0.8.1)
@@ -186,19 +186,19 @@ module RSMP
186
186
  @queries.each do |query|
187
187
  want = query.want
188
188
  got = query.got
189
- if got['cCI']
189
+ if want['cCI']
190
190
  cCI = want['cCI']
191
191
  h[cCI] ||= {}
192
192
  cO = want['cO']
193
193
  h[cCI][cO] ||= {}
194
194
  n = want['n']
195
- v = got['v']
195
+ v = got ? got['v'] : nil
196
196
  h[cCI][cO][n] = v
197
197
  elsif want['sCI']
198
198
  sCI = want['sCI']
199
199
  h[sCI] ||= {}
200
200
  n = want['n']
201
- s = got['s']
201
+ s = got ? got['s'] : nil
202
202
  h[sCI][n] = s
203
203
  end
204
204
  end
data/lib/rsmp/proxy.rb CHANGED
@@ -13,9 +13,10 @@ module RSMP
13
13
  include Inspect
14
14
  include Task
15
15
 
16
- attr_reader :state, :archive, :connection_info, :sxl, :collector, :ip, :port
16
+ attr_reader :state, :archive, :connection_info, :sxl, :collector, :ip, :port, :node
17
17
 
18
18
  def initialize options
19
+ @node = options[:node]
19
20
  initialize_logging options
20
21
  initialize_distributor
21
22
  initialize_task
@@ -120,7 +121,7 @@ module RSMP
120
121
  end
121
122
 
122
123
  def clock
123
- node.clock
124
+ @node.clock
124
125
  end
125
126
 
126
127
  def ready?
@@ -203,12 +204,11 @@ module RSMP
203
204
  end
204
205
 
205
206
  def notify_error e, options={}
206
- node.notify_error e, options
207
+ @node.notify_error e, options
207
208
  end
208
209
 
209
210
  def start_watchdog
210
211
  log "Starting watchdog with interval #{@site_settings['intervals']['watchdog']} seconds", level: :debug
211
- send_watchdog
212
212
  @watchdog_started = true
213
213
  end
214
214
 
@@ -369,7 +369,7 @@ module RSMP
369
369
  end
370
370
 
371
371
  def process_deferred
372
- node.process_deferred
372
+ @node.process_deferred
373
373
  end
374
374
 
375
375
  def verify_sequence message
@@ -419,7 +419,7 @@ module RSMP
419
419
  close
420
420
  message
421
421
  ensure
422
- node.clear_deferred
422
+ @node.clear_deferred
423
423
  end
424
424
 
425
425
  def process_message message
@@ -620,12 +620,8 @@ module RSMP
620
620
  def version_acknowledged
621
621
  end
622
622
 
623
- def node
624
- raise 'Must be overridden'
625
- end
626
-
627
623
  def author
628
- node.site_id
624
+ @node.site_id
629
625
  end
630
626
 
631
627
  def send_and_optionally_collect message, options, &block
@@ -7,7 +7,7 @@ module RSMP
7
7
  attr_reader :supervisor, :site_id
8
8
 
9
9
  def initialize options
10
- super options
10
+ super options.merge(node:options[:supervisor])
11
11
  initialize_components
12
12
  @supervisor = options[:supervisor]
13
13
  @settings = @supervisor.supervisor_settings.clone
@@ -47,7 +47,8 @@ module RSMP
47
47
  def handshake_complete
48
48
  super
49
49
  sanitized_sxl_version = RSMP::Schemer.sanitize_version(@site_sxl_version)
50
- log "Connection to site #{@site_id} established, using core #{@rsmp_version}, #{@sxl} #{sanitized_sxl_version}", level: :info
50
+ log "Connection to site #{@site_id} established, using core #{@rsmp_version}, #{@sxl} #{sanitized_sxl_version}", level: :log
51
+ start_watchdog
51
52
  end
52
53
 
53
54
  def process_message message
@@ -91,6 +92,20 @@ module RSMP
91
92
  @version_determined = true
92
93
  end
93
94
 
95
+ def acknowledged_first_ingoing message
96
+ case message.type
97
+ when "Watchdog"
98
+ send_watchdog
99
+ end
100
+ end
101
+
102
+ def acknowledged_first_outgoing message
103
+ case message.type
104
+ when "Watchdog"
105
+ handshake_complete
106
+ end
107
+ end
108
+
94
109
  def validate_ready action
95
110
  raise NotReady.new("Can't #{action} because connection is not ready. (Currently #{@state})") unless ready?
96
111
  end
@@ -152,14 +167,10 @@ module RSMP
152
167
  end
153
168
 
154
169
  def version_acknowledged
155
- handshake_complete
156
170
  end
157
171
 
158
172
  def process_watchdog message
159
173
  super
160
- if @watchdog_started == false
161
- start_watchdog
162
- end
163
174
  end
164
175
 
165
176
  def site_ids_changed
@@ -8,7 +8,7 @@ module RSMP
8
8
  attr_reader :supervisor_id, :site
9
9
 
10
10
  def initialize options
11
- super options
11
+ super options.merge(node:options[:site])
12
12
  @site = options[:site]
13
13
  @site_settings = @site.site_settings.clone
14
14
  @ip = options[:ip]
@@ -18,10 +18,6 @@ module RSMP
18
18
  @synthetic_id = Supervisor.build_id_from_ip_port @ip, @port
19
19
  end
20
20
 
21
- def node
22
- site
23
- end
24
-
25
21
  # handle communication
26
22
  # if disconnected, then try to reconnect
27
23
  def run
@@ -86,10 +82,11 @@ module RSMP
86
82
  end
87
83
 
88
84
  def handshake_complete
89
- super
90
85
  sanitized_sxl_version = RSMP::Schemer.sanitize_version(sxl_version)
91
86
  log "Connection to supervisor established, using core #{@rsmp_version}, #{sxl} #{sanitized_sxl_version}", level: :info
92
87
  start_watchdog
88
+ send_all_aggregated_status if @site_settings['send_after_connect']
89
+ super
93
90
  end
94
91
 
95
92
  def process_message message
@@ -124,10 +121,8 @@ module RSMP
124
121
  # aggregateds status should only be send for later version of rsmp
125
122
  # to handle verison differences, we probably need inherited classes
126
123
  case message.type
127
- when "Watchdog"
128
- if @site_settings['send_after_connect']
129
- send_all_aggregated_status
130
- end
124
+ when "Watchdog"
125
+ handshake_complete
131
126
  end
132
127
  end
133
128
 
@@ -152,8 +147,8 @@ module RSMP
152
147
  log "Received Version message, using RSMP #{@rsmp_version}", message: message, level: :log
153
148
  start_timer
154
149
  acknowledge message
155
- handshake_complete
156
150
  @version_determined = true
151
+ send_watchdog
157
152
  end
158
153
 
159
154
  def send_aggregated_status component, options={}
data/lib/rsmp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RSMP
2
- VERSION = "0.11.4"
2
+ VERSION = "0.11.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsmp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.4
4
+ version: 0.11.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emil Tin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-22 00:00:00.000000000 Z
11
+ date: 2022-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async