rsmp 0.15.1 → 0.16.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/config/tlc.yaml +1 -0
- data/lib/rsmp/proxy.rb +5 -7
- data/lib/rsmp/site.rb +1 -1
- data/lib/rsmp/site_proxy.rb +2 -6
- data/lib/rsmp/supervisor.rb +9 -3
- data/lib/rsmp/version.rb +1 -1
- data/rsmp.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 837b10c5d2e9549d0a30d5d27cc997622db9290cc9a6e559f84201625c84a266
|
4
|
+
data.tar.gz: 1b7fe703dc1c60f05cfeaacd0ff290dac0684a1dabe851cef624f1309eeca11c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a28c3dba00e688d988173e6ca73121b25bac653b2a1906a33292a17e950a47de28e1218327505464ea5706c4474725c15f4324992c9af641a945274760968ce
|
7
|
+
data.tar.gz: 1d9600064f773fbc70aa64cc0aabaf1b64091623a9ba7669af8676369f527831ab2df595c51b10e924ed2ae1f4f34bcd92486af7d7b940b23b304caa426bc332
|
data/Gemfile.lock
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rsmp (0.
|
4
|
+
rsmp (0.16.1)
|
5
5
|
async (~> 1.30.3)
|
6
6
|
async-io (~> 1.33.0)
|
7
7
|
colorize (~> 0.8.1)
|
8
|
-
rsmp_schema (~> 0.
|
8
|
+
rsmp_schema (~> 0.3.1)
|
9
9
|
thor (~> 1.2.1)
|
10
10
|
|
11
11
|
GEM
|
@@ -80,7 +80,7 @@ GEM
|
|
80
80
|
nio4r (2.5.8)
|
81
81
|
rake (13.0.6)
|
82
82
|
regexp_parser (2.5.0)
|
83
|
-
rsmp_schema (0.
|
83
|
+
rsmp_schema (0.3.1)
|
84
84
|
json_schemer (~> 0.2.21)
|
85
85
|
thor (~> 1.2.1)
|
86
86
|
rspec (3.10.0)
|
@@ -100,7 +100,7 @@ GEM
|
|
100
100
|
ffi (~> 1.1)
|
101
101
|
thor (1.2.1)
|
102
102
|
timecop (0.9.5)
|
103
|
-
timers (4.3.
|
103
|
+
timers (4.3.4)
|
104
104
|
uri_template (0.7.0)
|
105
105
|
|
106
106
|
PLATFORMS
|
data/config/tlc.yaml
CHANGED
data/lib/rsmp/proxy.rb
CHANGED
@@ -13,7 +13,7 @@ module RSMP
|
|
13
13
|
include Inspect
|
14
14
|
include Task
|
15
15
|
|
16
|
-
attr_reader :state, :archive, :connection_info, :sxl, :collector, :ip, :port, :node
|
16
|
+
attr_reader :state, :archive, :connection_info, :sxl, :collector, :ip, :port, :node, :rsmp_version
|
17
17
|
|
18
18
|
def initialize options
|
19
19
|
@node = options[:node]
|
@@ -28,6 +28,7 @@ module RSMP
|
|
28
28
|
def disconnect
|
29
29
|
end
|
30
30
|
|
31
|
+
|
31
32
|
# wait for the reader task to complete,
|
32
33
|
# which is not expected to happen before the connection is closed
|
33
34
|
def wait_for_reader
|
@@ -314,12 +315,9 @@ module RSMP
|
|
314
315
|
end
|
315
316
|
|
316
317
|
def get_schemas
|
317
|
-
# normally we have an sxl, but during connection, it hasn't been established yet
|
318
|
-
# at these times we only validate against the core schema
|
319
|
-
# TODO
|
320
|
-
# what schema should we use to validate the initial Version and MessageAck messages?
|
321
318
|
schemas = { core: RSMP::Schema.latest_core_version } # use latest core
|
322
|
-
schemas[
|
319
|
+
schemas[:core] = rsmp_versions.last if rsmp_versions
|
320
|
+
schemas[sxl] = RSMP::Schema.sanitize_version(sxl_version.to_s) if sxl && sxl_version
|
323
321
|
schemas
|
324
322
|
end
|
325
323
|
|
@@ -460,7 +458,7 @@ module RSMP
|
|
460
458
|
def rsmp_versions
|
461
459
|
return [RSMP::Schema.latest_core_version] if @site_settings["rsmp_versions"] == 'latest'
|
462
460
|
return RSMP::Schema.core_versions if @site_settings["rsmp_versions"] == 'all'
|
463
|
-
@site_settings["rsmp_versions"]
|
461
|
+
[@site_settings["rsmp_versions"]].flatten
|
464
462
|
end
|
465
463
|
|
466
464
|
def check_rsmp_version message
|
data/lib/rsmp/site.rb
CHANGED
data/lib/rsmp/site_proxy.rb
CHANGED
@@ -48,7 +48,7 @@ module RSMP
|
|
48
48
|
def handshake_complete
|
49
49
|
super
|
50
50
|
sanitized_sxl_version = RSMP::Schema.sanitize_version(@site_sxl_version)
|
51
|
-
log "Connection to site #{@site_id} established, using core #{@rsmp_version}, #{@sxl} #{sanitized_sxl_version}", level: :
|
51
|
+
log "Connection to site #{@site_id} established, using core #{@rsmp_version}, #{@sxl} #{sanitized_sxl_version}", level: :info
|
52
52
|
start_watchdog
|
53
53
|
end
|
54
54
|
|
@@ -308,11 +308,10 @@ module RSMP
|
|
308
308
|
end
|
309
309
|
|
310
310
|
def check_sxl_version message
|
311
|
-
|
312
311
|
# check that we have a schema for specified sxl type and version
|
313
312
|
# note that the type comes from the site config, while the version
|
314
313
|
# comes from the Version message send by the site
|
315
|
-
type = '
|
314
|
+
type = @site_settings['sxl']
|
316
315
|
version = message.attribute 'SXL'
|
317
316
|
RSMP::Schema::find_schema! type, version, lenient: true
|
318
317
|
|
@@ -332,7 +331,6 @@ module RSMP
|
|
332
331
|
def process_version message
|
333
332
|
return extraneous_version message if @version_determined
|
334
333
|
check_site_ids message
|
335
|
-
check_rsmp_version message
|
336
334
|
check_sxl_version message
|
337
335
|
version_accepted message
|
338
336
|
end
|
@@ -341,8 +339,6 @@ module RSMP
|
|
341
339
|
# RSMP support multiple site ids. we don't support this yet. instead we use the first id only
|
342
340
|
site_id = message.attribute("siteId").map { |item| item["sId"] }.first
|
343
341
|
@supervisor.check_site_id site_id
|
344
|
-
@site_id = site_id
|
345
|
-
setup_site_settings
|
346
342
|
site_ids_changed
|
347
343
|
end
|
348
344
|
|
data/lib/rsmp/supervisor.rb
CHANGED
@@ -138,8 +138,7 @@ module RSMP
|
|
138
138
|
def peek_version_message protocol
|
139
139
|
json = protocol.peek_line
|
140
140
|
attributes = Message.parse_attributes json
|
141
|
-
|
142
|
-
message.attribute('siteId').first['sId']
|
141
|
+
Message.build attributes, json
|
143
142
|
end
|
144
143
|
|
145
144
|
# accept an incoming connecting by creating and starting a proxy
|
@@ -169,7 +168,9 @@ module RSMP
|
|
169
168
|
archive: @archive
|
170
169
|
}
|
171
170
|
|
172
|
-
|
171
|
+
version_message = peek_version_message protocol
|
172
|
+
id = version_message.attribute('siteId').first['sId']
|
173
|
+
|
173
174
|
proxy = find_site id
|
174
175
|
if proxy
|
175
176
|
if proxy.connected?
|
@@ -182,6 +183,11 @@ module RSMP
|
|
182
183
|
proxy = build_proxy settings.merge(site_id:id) # keep the id learned by peeking above
|
183
184
|
@proxies.push proxy
|
184
185
|
end
|
186
|
+
|
187
|
+
proxy.setup_site_settings
|
188
|
+
proxy.check_rsmp_version version_message
|
189
|
+
log "Validating using core version #{proxy.rsmp_version}", level: :debug
|
190
|
+
|
185
191
|
proxy.start # will run until the site disconnects
|
186
192
|
proxy.wait
|
187
193
|
ensure
|
data/lib/rsmp/version.rb
CHANGED
data/rsmp.gemspec
CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.add_dependency "async-io", "~> 1.33.0"
|
35
35
|
spec.add_dependency "colorize", "~> 0.8.1"
|
36
36
|
spec.add_dependency "thor", "~> 1.2.1"
|
37
|
-
spec.add_dependency "rsmp_schema", "~> 0.
|
37
|
+
spec.add_dependency "rsmp_schema", "~> 0.3.1"
|
38
38
|
|
39
39
|
spec.add_development_dependency "bundler", "~> 2.3.7"
|
40
40
|
spec.add_development_dependency "rake", "~> 13.0.6"
|
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.
|
4
|
+
version: 0.16.1
|
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-09-
|
11
|
+
date: 2022-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.3.1
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: 0.3.1
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: bundler
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|