zyre 0.1.0 → 0.4.1
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
- checksums.yaml.gz.sig +3 -2
- data.tar.gz.sig +0 -0
- data/Authentication.md +30 -0
- data/History.md +36 -0
- data/README.md +70 -6
- data/ext/zyre_ext/cert.c +504 -0
- data/ext/zyre_ext/event.c +105 -33
- data/ext/zyre_ext/extconf.rb +5 -0
- data/ext/zyre_ext/node.c +283 -38
- data/ext/zyre_ext/poller.c +6 -7
- data/ext/zyre_ext/zyre_ext.c +104 -1
- data/ext/zyre_ext/zyre_ext.h +25 -2
- data/lib/observability/instrumentation/zyre.rb +4 -4
- data/lib/zyre.rb +38 -14
- data/lib/zyre/cert.rb +75 -0
- data/lib/zyre/event.rb +9 -0
- data/lib/zyre/event/leader.rb +18 -0
- data/lib/zyre/event/stop.rb +5 -0
- data/lib/zyre/testing.rb +36 -3
- data/spec/observability/instrumentation/zyre_spec.rb +2 -2
- data/spec/spec_helper.rb +4 -0
- data/spec/zyre/cert_spec.rb +218 -0
- data/spec/zyre/event_spec.rb +62 -0
- data/spec/zyre/node_spec.rb +195 -8
- data/spec/zyre/testing_spec.rb +72 -0
- data/spec/zyre_spec.rb +12 -0
- metadata +22 -17
- metadata.gz.sig +0 -0
data/spec/zyre/testing_spec.rb
CHANGED
@@ -181,6 +181,20 @@ RSpec.describe( Zyre::Testing ) do
|
|
181
181
|
end
|
182
182
|
|
183
183
|
|
184
|
+
it "can override SHOUT event message and group using positional parameters" do
|
185
|
+
event = factory.shout( 'control', 'data1', 'data2' )
|
186
|
+
|
187
|
+
expect( event ).to be_a( Zyre::Event::Shout )
|
188
|
+
expect( event.peer_uuid ).to eq( factory.peer_uuid )
|
189
|
+
expect( event.peer_name ).to eq( 'lancer-6' )
|
190
|
+
expect( event.headers ).to be_empty
|
191
|
+
expect( event.msg ).to eq( 'data1' )
|
192
|
+
expect( event ).to be_multipart
|
193
|
+
expect( event.multipart_msg ).to eq( ['data1'.b, 'data2'.b] )
|
194
|
+
expect( event.group ).to eq( 'control' )
|
195
|
+
end
|
196
|
+
|
197
|
+
|
184
198
|
it "can create a valid WHISPER event" do
|
185
199
|
event = factory.whisper
|
186
200
|
|
@@ -193,6 +207,14 @@ RSpec.describe( Zyre::Testing ) do
|
|
193
207
|
end
|
194
208
|
|
195
209
|
|
210
|
+
it "can create a valid WHISPER event with a multipart msg" do
|
211
|
+
event = factory.whisper( msg: %w[three times fool] )
|
212
|
+
|
213
|
+
expect( event ).to be_multipart
|
214
|
+
expect( event.multipart_msg ).to eq( %w[three times fool] )
|
215
|
+
end
|
216
|
+
|
217
|
+
|
196
218
|
it "can create a valid WHISPER event with overridden config" do
|
197
219
|
uuid = SecureRandom.uuid.tr( '-', '' )
|
198
220
|
event = factory.whisper( peer_uuid: uuid, msg: 'stop' )
|
@@ -206,6 +228,20 @@ RSpec.describe( Zyre::Testing ) do
|
|
206
228
|
end
|
207
229
|
|
208
230
|
|
231
|
+
it "can override WHISPER event message using positional parameters" do
|
232
|
+
event = factory.whisper( 'ignored', 'data1', 'data2' )
|
233
|
+
|
234
|
+
expect( event ).to be_a( Zyre::Event::Whisper )
|
235
|
+
expect( event.peer_uuid ).to eq( factory.peer_uuid )
|
236
|
+
expect( event.peer_name ).to eq( 'lancer-6' )
|
237
|
+
expect( event.headers ).to be_empty
|
238
|
+
expect( event.msg ).to eq( 'data1' )
|
239
|
+
expect( event ).to be_multipart
|
240
|
+
expect( event.multipart_msg ).to eq( ['data1', 'data2'] )
|
241
|
+
expect( event.group ).to be_nil
|
242
|
+
end
|
243
|
+
|
244
|
+
|
209
245
|
it "can create a valid LEAVE event" do
|
210
246
|
event = factory.leave
|
211
247
|
|
@@ -230,6 +266,42 @@ RSpec.describe( Zyre::Testing ) do
|
|
230
266
|
end
|
231
267
|
|
232
268
|
|
269
|
+
it "can create a valid LEADER event" do
|
270
|
+
event = factory.leader
|
271
|
+
|
272
|
+
expect( event ).to be_a( Zyre::Event::Leader )
|
273
|
+
expect( event.peer_uuid ).to eq( factory.peer_uuid )
|
274
|
+
expect( event.peer_name ).to eq( 'lancer-6' )
|
275
|
+
expect( event.headers ).to be_empty
|
276
|
+
expect( event.msg ).to be_nil
|
277
|
+
expect( event.group ).to eq( 'default' )
|
278
|
+
end
|
279
|
+
|
280
|
+
|
281
|
+
it "can create a valid LEAVE event with overridden config" do
|
282
|
+
event = factory.leader( group: 'control' )
|
283
|
+
|
284
|
+
expect( event ).to be_a( Zyre::Event::Leader )
|
285
|
+
expect( event.peer_uuid ).to eq( factory.peer_uuid )
|
286
|
+
expect( event.peer_name ).to eq( 'lancer-6' )
|
287
|
+
expect( event.headers ).to be_empty
|
288
|
+
expect( event.msg ).to be_nil
|
289
|
+
expect( event.group ).to eq( 'control' )
|
290
|
+
end
|
291
|
+
|
292
|
+
|
293
|
+
it "can create a valid STOP event" do
|
294
|
+
event = factory.stop
|
295
|
+
|
296
|
+
expect( event ).to be_a( Zyre::Event::Stop )
|
297
|
+
expect( event.peer_uuid ).to eq( factory.peer_uuid )
|
298
|
+
expect( event.peer_name ).to eq( 'lancer-6' )
|
299
|
+
expect( event.headers ).to be_empty
|
300
|
+
expect( event.msg ).to be_nil
|
301
|
+
expect( event.group ).to be_nil
|
302
|
+
end
|
303
|
+
|
304
|
+
|
233
305
|
it "can create a valid EXIT event" do
|
234
306
|
event = factory.exit
|
235
307
|
|
data/spec/zyre_spec.rb
CHANGED
@@ -51,5 +51,17 @@ RSpec.describe Zyre do
|
|
51
51
|
expect( result['disposition'].encoding ).to eq( Encoding::US_ASCII )
|
52
52
|
end
|
53
53
|
|
54
|
+
|
55
|
+
it "can disable the CZMQ TERM/INT signal handler" do
|
56
|
+
expect {
|
57
|
+
described_class.disable_zsys_handler
|
58
|
+
}.to_not raise_error()
|
59
|
+
end
|
60
|
+
|
61
|
+
|
62
|
+
it "knows whether or not it's been built with draft APIs" do
|
63
|
+
expect( described_class.has_draft_apis? ).to eq( true ).or( eq false )
|
64
|
+
end
|
65
|
+
|
54
66
|
end
|
55
67
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zyre
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Granger
|
@@ -10,9 +10,9 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
MIID+
|
14
|
-
|
15
|
-
|
13
|
+
MIID+DCCAmCgAwIBAgIBAzANBgkqhkiG9w0BAQsFADAiMSAwHgYDVQQDDBdnZWQv
|
14
|
+
REM9RmFlcmllTVVEL0RDPW9yZzAeFw0yMDEyMjQyMDU1MjlaFw0yMTEyMjQyMDU1
|
15
|
+
MjlaMCIxIDAeBgNVBAMMF2dlZC9EQz1GYWVyaWVNVUQvREM9b3JnMIIBojANBgkq
|
16
16
|
hkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAvyVhkRzvlEs0fe7145BYLfN6njX9ih5H
|
17
17
|
L60U0p0euIurpv84op9CNKF9tx+1WKwyQvQP7qFGuZxkSUuWcP/sFhDXL1lWUuIl
|
18
18
|
M4uHbGCRmOshDrF4dgnBeOvkHr1fIhPlJm5FO+Vew8tSQmlDsosxLUx+VB7DrVFO
|
@@ -23,17 +23,17 @@ cert_chain:
|
|
23
23
|
ozilJg4aar2okb/RA6VS87o+d7g6LpDDMMQjH4G9OPnJENLdhu8KnPw/ivSVvQw7
|
24
24
|
N2I4L/ZOIe2DIVuYH7aLHfjZDQv/mNgpAgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYD
|
25
25
|
VR0PBAQDAgSwMB0GA1UdDgQWBBRyjf55EbrHagiRLqt5YAd3yb8k4DANBgkqhkiG
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
26
|
+
9w0BAQsFAAOCAYEAMYegZanJi8zq7QKPT7wqXefX4C88I5JWeBHR3PvvWK0CwyMV
|
27
|
+
peyiu5I13w/lYX+HUZjE4qsSpJMJFXWl4WZCOo+AMprOcf0PxfuJpxCej5D4tavf
|
28
|
+
vRfhahSw7XJrcZih/3J+/UgoH7R05MJ+8LTcy3HGrB3a0vTafjm8OY7Xpa0LJDoN
|
29
|
+
JDqxK321VIHyTibbKeA1hWSE6ljlQDvFbTqiCj3Ulp1jTv3TOlvRl8fqcfhxUJI0
|
30
|
+
+5Q82jJODjEN+GaWs0V+NlrbU94cXwS2PH5dXogftB5YYA5Ex8A0ikZ73xns4Hdo
|
31
|
+
XxdLdd92F5ovxA23j/rKe/IDwqr6FpDkU3nPXH/Qp0TVGv9zZnVJc/Z6ChkuWj8z
|
32
|
+
pW7JAyyiiHZgKKDReDrA2LA7Zs3o/7KA6UtUH0FHf8LYhcK+pfHk6RtjRe65ffw+
|
33
|
+
MCh97sQ/Z/MOusb5+QddBmB+k8EicXyGNl4b5L4XpL7fIQu+Y96TB3JEJlShxFD9
|
34
|
+
k9FjI4d9EP54gS/4
|
35
35
|
-----END CERTIFICATE-----
|
36
|
-
date:
|
36
|
+
date: 2021-03-16 00:00:00.000000000 Z
|
37
37
|
dependencies:
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: loggability
|
@@ -41,14 +41,14 @@ dependencies:
|
|
41
41
|
requirements:
|
42
42
|
- - "~>"
|
43
43
|
- !ruby/object:Gem::Version
|
44
|
-
version: '0.
|
44
|
+
version: '0.18'
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
47
|
version_requirements: !ruby/object:Gem::Requirement
|
48
48
|
requirements:
|
49
49
|
- - "~>"
|
50
50
|
- !ruby/object:Gem::Version
|
51
|
-
version: '0.
|
51
|
+
version: '0.18'
|
52
52
|
- !ruby/object:Gem::Dependency
|
53
53
|
name: rake-deveiate
|
54
54
|
requirement: !ruby/object:Gem::Requirement
|
@@ -163,9 +163,11 @@ extensions:
|
|
163
163
|
- ext/zyre_ext/extconf.rb
|
164
164
|
extra_rdoc_files: []
|
165
165
|
files:
|
166
|
+
- Authentication.md
|
166
167
|
- History.md
|
167
168
|
- LICENSE.txt
|
168
169
|
- README.md
|
170
|
+
- ext/zyre_ext/cert.c
|
169
171
|
- ext/zyre_ext/event.c
|
170
172
|
- ext/zyre_ext/extconf.rb
|
171
173
|
- ext/zyre_ext/node.c
|
@@ -174,11 +176,13 @@ files:
|
|
174
176
|
- ext/zyre_ext/zyre_ext.h
|
175
177
|
- lib/observability/instrumentation/zyre.rb
|
176
178
|
- lib/zyre.rb
|
179
|
+
- lib/zyre/cert.rb
|
177
180
|
- lib/zyre/event.rb
|
178
181
|
- lib/zyre/event/enter.rb
|
179
182
|
- lib/zyre/event/evasive.rb
|
180
183
|
- lib/zyre/event/exit.rb
|
181
184
|
- lib/zyre/event/join.rb
|
185
|
+
- lib/zyre/event/leader.rb
|
182
186
|
- lib/zyre/event/leave.rb
|
183
187
|
- lib/zyre/event/shout.rb
|
184
188
|
- lib/zyre/event/silent.rb
|
@@ -189,6 +193,7 @@ files:
|
|
189
193
|
- lib/zyre/testing.rb
|
190
194
|
- spec/observability/instrumentation/zyre_spec.rb
|
191
195
|
- spec/spec_helper.rb
|
196
|
+
- spec/zyre/cert_spec.rb
|
192
197
|
- spec/zyre/event_spec.rb
|
193
198
|
- spec/zyre/node_spec.rb
|
194
199
|
- spec/zyre/poller_spec.rb
|
@@ -217,7 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
217
222
|
- !ruby/object:Gem::Version
|
218
223
|
version: '0'
|
219
224
|
requirements: []
|
220
|
-
rubygems_version: 3.
|
225
|
+
rubygems_version: 3.2.3
|
221
226
|
signing_key:
|
222
227
|
specification_version: 4
|
223
228
|
summary: A ZRE library for Ruby.
|
metadata.gz.sig
CHANGED
Binary file
|