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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b288fb83c9508f5e1b41bd9d3035b0fa6a2f1b1f3adc35889a1f0fd21d257d7
4
- data.tar.gz: 25c243cd72c6f84529a6a811ba30c313a4342c693d7e3815788ca94f56bccdd7
3
+ metadata.gz: '0913144e2536ad8910269c7bc0c513b756f6c5d62c39e88827703798a76565b3'
4
+ data.tar.gz: 1f08fa6c65186758f916775075773cf9745d62a4958b4713c3d036a1078aa128
5
5
  SHA512:
6
- metadata.gz: 95f3d18ee1e94a759068b4861304cd388781e96e8ec719ffbdd6b3eebedc102285f3d6d8cf88114c8d8c7346f6a9f16ce7bdbd46bdf22f46c5d7bddd54c1fd5a
7
- data.tar.gz: d1e27c106eed00de4583ff5cc32c0f79895dbecad8726ca73601270485838ddf860029efbe18eb95d40f4ec522dccfb0fdd42c12af125d6b3a704c3a42e5daa3
6
+ metadata.gz: 3840694739dcb2562b26fc20e76da756df5d85ab86458794930dfc76d3f16db0ee228a3cbc6473a6b6b8daa2972a5492c480b99bcff6643a2d9075283d6e5d02
7
+ data.tar.gz: 4d370c0f125b6e803d7ede0c97b3710e5080024615795c79279c959013f18d9ef472cd8df3664e5b124de70fb550db20046f820bfe348c130521cfb3ca57d1de
data/CHANGES.md CHANGED
@@ -1,3 +1,10 @@
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
+
1
8
  2.0.0.rc3
2
9
  -----
3
10
 
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 (the default) ---
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
- # --- defer subscription, add later ---
187
- sub = Cztop::Socket::SUB.new('tcp://localhost:5556', prefix: nil)
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')
@@ -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
- # everything ({EVERYTHING}). Pass +nil+ to skip subscribing.
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: EVERYTHING, curve: nil, linger: 0)
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module CZTop
4
4
 
5
- VERSION = '2.0.0.rc3'
5
+ VERSION = '2.0.0'
6
6
 
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cztop
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.rc3
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrik Wenger