cztop 2.0.0.rc3 → 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 +7 -0
- data/ZGUIDE_SUMMARY.md +6 -7
- data/lib/cztop/socket/sub.rb +3 -3
- 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
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/version.rb
CHANGED