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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3381b5cf1edd7c878bb5c26ccc16bf096a354cfab0724a8da61e7f4ce3146272
4
- data.tar.gz: c6081e0b22ee66190b3d34eb9d4d6a2d5ecfda537e8cdbfc223cfd23d2b56e9f
3
+ metadata.gz: '0913144e2536ad8910269c7bc0c513b756f6c5d62c39e88827703798a76565b3'
4
+ data.tar.gz: 1f08fa6c65186758f916775075773cf9745d62a4958b4713c3d036a1078aa128
5
5
  SHA512:
6
- metadata.gz: 8142a5ff3b45d88a3ebfc35b3a002dfb8b9be5937f0c37e1779530229d959b0457a1dfd49c062550b2c46d9389e5c3937272e979e5b703d09f68ed4732925201
7
- data.tar.gz: 8591012e556649e6397c16a871f8f892a8b111ec06339e3271d03fd5eca187268363258429a949eb1d03c8245907cfbf30ae00662d9168f47e28aea14592094f
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 (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/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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module CZTop
4
4
 
5
- VERSION = '2.0.0.rc2'
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.rc2
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrik Wenger