cztop 2.0.0.rc2 → 2.0.0
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/CHANGES.md +12 -0
- data/ZGUIDE_SUMMARY.md +6 -7
- data/lib/cztop/socket/sub.rb +3 -3
- data/lib/cztop/socket.rb +2 -0
- data/lib/cztop/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: '0913144e2536ad8910269c7bc0c513b756f6c5d62c39e88827703798a76565b3'
|
|
4
|
+
data.tar.gz: 1f08fa6c65186758f916775075773cf9745d62a4958b4713c3d036a1078aa128
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3840694739dcb2562b26fc20e76da756df5d85ab86458794930dfc76d3f16db0ee228a3cbc6473a6b6b8daa2972a5492c480b99bcff6643a2d9075283d6e5d02
|
|
7
|
+
data.tar.gz: 4d370c0f125b6e803d7ede0c97b3710e5080024615795c79279c959013f18d9ef472cd8df3664e5b124de70fb550db20046f820bfe348c130521cfb3ca57d1de
|
data/CHANGES.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
2.0.0
|
|
2
|
+
-----
|
|
3
|
+
|
|
4
|
+
* `Socket::SUB` no longer auto-subscribes to everything — constructor `prefix:`
|
|
5
|
+
now defaults to `nil` (no subscription). Call `#subscribe` explicitly or pass
|
|
6
|
+
`prefix: ""` to subscribe to all messages.
|
|
7
|
+
|
|
8
|
+
2.0.0.rc3
|
|
9
|
+
-----
|
|
10
|
+
|
|
11
|
+
* `#close` and `#set_unbounded` now return `nil` instead of leaking FFI objects
|
|
12
|
+
|
|
1
13
|
2.0.0.rc2
|
|
2
14
|
-----
|
|
3
15
|
|
data/ZGUIDE_SUMMARY.md
CHANGED
|
@@ -180,12 +180,11 @@ loop do
|
|
|
180
180
|
puts msg.first
|
|
181
181
|
end
|
|
182
182
|
|
|
183
|
-
# --- subscribe to everything
|
|
184
|
-
sub = Cztop::Socket::SUB.connect('tcp://localhost:5556')
|
|
183
|
+
# --- subscribe to everything ---
|
|
184
|
+
sub = Cztop::Socket::SUB.connect('tcp://localhost:5556', prefix: '')
|
|
185
185
|
|
|
186
|
-
# ---
|
|
187
|
-
sub = Cztop::Socket::SUB.
|
|
188
|
-
sub.subscribe('weather.sfo')
|
|
186
|
+
# --- subscribe to a specific prefix ---
|
|
187
|
+
sub = Cztop::Socket::SUB.connect('tcp://localhost:5556', prefix: 'weather.sfo')
|
|
189
188
|
```
|
|
190
189
|
|
|
191
190
|
→ see [`examples/zguide/02_pub_sub.rb`](examples/zguide/02_pub_sub.rb)
|
|
@@ -798,7 +797,7 @@ in the snapshot using the sequence number.
|
|
|
798
797
|
|
|
799
798
|
```ruby
|
|
800
799
|
# Clone client sketch
|
|
801
|
-
sub = Cztop::Socket::SUB.connect(pub_endpoint)
|
|
800
|
+
sub = Cztop::Socket::SUB.connect(pub_endpoint, prefix: '')
|
|
802
801
|
sub.recv_timeout = 1
|
|
803
802
|
|
|
804
803
|
# Subscribe first, snapshot second
|
|
@@ -906,7 +905,7 @@ is a feature.
|
|
|
906
905
|
```ruby
|
|
907
906
|
# Class methods (preferred)
|
|
908
907
|
pub = Cztop::Socket::PUB.bind('tcp://*:5556')
|
|
909
|
-
sub = Cztop::Socket::SUB.connect('tcp://localhost:5556')
|
|
908
|
+
sub = Cztop::Socket::SUB.connect('tcp://localhost:5556', prefix: '')
|
|
910
909
|
|
|
911
910
|
# Constructor
|
|
912
911
|
pub = Cztop::Socket::PUB.new('tcp://*:5556')
|
data/lib/cztop/socket/sub.rb
CHANGED
|
@@ -14,12 +14,12 @@ module CZTop
|
|
|
14
14
|
EVERYTHING = ''
|
|
15
15
|
|
|
16
16
|
# @param endpoints [String] endpoints to connect to
|
|
17
|
-
# @param prefix [String, nil] subscription prefix; defaults to
|
|
18
|
-
#
|
|
17
|
+
# @param prefix [String, nil] subscription prefix; defaults to no
|
|
18
|
+
# subscription. Pass {EVERYTHING} (+""+) to subscribe to everything.
|
|
19
19
|
# @param curve [Hash, nil] CURVE encryption options
|
|
20
20
|
# @param linger [Integer] linger period in milliseconds (default: 0)
|
|
21
21
|
#
|
|
22
|
-
def initialize(endpoints = nil, prefix:
|
|
22
|
+
def initialize(endpoints = nil, prefix: nil, curve: nil, linger: 0)
|
|
23
23
|
super(endpoints, curve: curve, linger: linger)
|
|
24
24
|
|
|
25
25
|
attach_ffi_delegate(Zsock.new(Types::SUB))
|
data/lib/cztop/socket.rb
CHANGED
|
@@ -72,6 +72,7 @@ module CZTop
|
|
|
72
72
|
#
|
|
73
73
|
def close
|
|
74
74
|
ffi_delegate.destroy
|
|
75
|
+
nil
|
|
75
76
|
end
|
|
76
77
|
|
|
77
78
|
# @return [Integer] last automatically selected, bound TCP port, if any
|
|
@@ -109,6 +110,7 @@ module CZTop
|
|
|
109
110
|
#
|
|
110
111
|
def set_unbounded
|
|
111
112
|
::CZMQ::FFI::Zsock.set_unbounded(ffi_delegate)
|
|
113
|
+
nil
|
|
112
114
|
end
|
|
113
115
|
|
|
114
116
|
|
data/lib/cztop/version.rb
CHANGED