cztop 1.2.4 → 1.2.5

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: c158b4eded1b181765d923d869fc6b9f959313f7640bfc3dc8b47b113dcf4d5c
4
- data.tar.gz: afcca2379f96a9569f1776938873767fcbaaa78ec3a08faf2f860b17b42b6f34
3
+ metadata.gz: f69946c755652d803136712eb37943759d0266b68c6cf7be08d87a70c3fa84c9
4
+ data.tar.gz: 7019a58ab3cfd1ad5670b7ae7a2af5eb27a50b19186e2a7c727de98121cab529
5
5
  SHA512:
6
- metadata.gz: f4ab7318be7ef914957517c7dc8bb9d4030faa89b86de08479d5ad4fcc63b544745f19d0945d119898a378855f51039788f89df0dd3b9994ec2801100d5f31c3
7
- data.tar.gz: 3d68e63fb44e994bcac69c76855991c8f71a4c275f76c9afcd728ccc3d3e906d1f25359bf36861136ac8252e6b433bcbec81047217a18052900a7ae3e302f0ce
6
+ metadata.gz: 74c495a413b86d3dbefcea43701aca13f4f6c13640b206da210d0b9f3c132e29f93750908e73dc8b7929b37dca199fb99f4bd6dfd78083e155d84cfb12c1343d
7
+ data.tar.gz: fa73f38fc6923d6eb92272a55e00b3ac7bbad5d9031a101b93cdd83618cb3e2e301b0a68a029658800692bb1c35c905220b4af089c42db1dc65ff89c270b91fb
data/CHANGES.md CHANGED
@@ -1,3 +1,14 @@
1
+ 1.2.5 (7/11/2024)
2
+ -----
3
+ * CZTop::Socket::ROUTER#wait_writable: don't raise SocketError if no peer is connected
4
+ - even if ZMQ_ROUTER_MANDATORY is set
5
+ - this can be used to wait for connected peers
6
+ - set a #sndtimeo if you want a an exception
7
+ * CZTop::Socket::CLIENT#wait_writable: don't raise SocketError if no peer is connected
8
+ - this can be used to wait for connected peers
9
+ - set a #sndtimeo if you want a an exception
10
+ * CZTop::ZsockOptions#[] and #[]=: avoid calling #public_methods if possible
11
+
1
12
  1.2.4 (1/16/2024)
2
13
  -----
3
14
  * PolymorphicZsockMethods#wait: fail with NotImplementedError inside non-blocking Fibers
data/CONTRIBUTORS.md ADDED
@@ -0,0 +1,7 @@
1
+ # Financial contributions
2
+ * @prdn (Paolo Ardoino <paolo@bitfinex.com>)
3
+
4
+ # Code contributions
5
+ * @joegoggins (Joe Goggins <joe.goggins@gmail.com>)
6
+ * @colstrom (Chris Olstrom <chris@olstrom.com>)
7
+ * @kozo2 (Kozo Nishida)
@@ -75,16 +75,6 @@ module CZTop
75
75
 
76
76
  attach_ffi_delegate(Zsock.new_client(endpoints))
77
77
  end
78
-
79
-
80
- # @raise [SocketError] if no peer is connected
81
- def wait_writable(...)
82
- if !writable?
83
- fail SocketError, "no peer connected"
84
- end
85
-
86
- super
87
- end
88
78
  end
89
79
 
90
80
 
@@ -168,16 +158,6 @@ module CZTop
168
158
  message.prepend receiver # receiver envelope
169
159
  self << message
170
160
  end
171
-
172
-
173
- # @raise [SocketError] if ZMQ_ROUTER_MANDATORY option and message is currently not routable
174
- def wait_writable(...)
175
- if options.router_mandatory? && !writable?
176
- fail SocketError, "no peer connected"
177
- end
178
-
179
- super
180
- end
181
161
  end
182
162
 
183
163
 
data/lib/cztop/version.rb CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  module CZTop
4
4
 
5
- VERSION = '1.2.4'
5
+ VERSION = '1.2.5'
6
6
 
7
7
  end
@@ -64,13 +64,23 @@ module CZTop
64
64
 
65
65
  # Fuzzy option getter. This is to make it easier when porting
66
66
  # applications from CZMQ libraries to CZTop.
67
+ #
67
68
  # @param option_name [Symbol, String] case insensitive option name
68
69
  # @raise [NoMethodError] if option name can't be recognized
69
70
  def [](option_name)
70
- # NOTE: beware of predicates, especially #CURVE_server? & friends
71
- meth = public_methods.grep_v(/=$/)
72
- .find { |m| m =~ /^#{option_name}\??$/i }
73
- raise NoMethodError, option_name if meth.nil?
71
+ meth1 = :"#{option_name}"
72
+ meth2 = :"#{option_name}?"
73
+
74
+ if respond_to? meth1
75
+ meth = meth1
76
+ elsif respond_to? meth2
77
+ meth = meth2
78
+ else
79
+ # NOTE: beware of predicates, especially #CURVE_server? & friends
80
+ meth = public_methods.grep_v(/=$/)
81
+ .find { |m| m =~ /^#{option_name}\??$/i }
82
+ raise NoMethodError, option_name if meth.nil?
83
+ end
74
84
 
75
85
  __send__(meth)
76
86
  end
@@ -78,12 +88,17 @@ module CZTop
78
88
 
79
89
  # Fuzzy option setter. This is to make it easier when porting
80
90
  # applications from CZMQ libraries to CZTop.
91
+ #
81
92
  # @param option_name [Symbol, String] case insensitive option name
82
93
  # @param new_value [String, Integer] new value
83
94
  # @raise [NoMethodError] if option name can't be recognized
84
95
  def []=(option_name, new_value)
85
- meth = public_methods.find { |m| m =~ /^#{option_name}=$/i }
86
- raise NoMethodError, option_name if meth.nil?
96
+ meth = :"#{option_name}="
97
+
98
+ unless respond_to? meth
99
+ meth = public_methods.find { |m| m =~ /^#{option_name}=$/i }
100
+ raise NoMethodError, option_name if meth.nil?
101
+ end
87
102
 
88
103
  __send__(meth, new_value)
89
104
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cztop
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrik Wenger
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-16 00:00:00.000000000 Z
11
+ date: 2024-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: czmq-ffi-gen
@@ -147,6 +147,7 @@ extra_rdoc_files: []
147
147
  files:
148
148
  - AUTHORS
149
149
  - CHANGES.md
150
+ - CONTRIBUTORS.md
150
151
  - Gemfile
151
152
  - LICENSE
152
153
  - README.md
@@ -208,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
209
  - !ruby/object:Gem::Version
209
210
  version: '0'
210
211
  requirements: []
211
- rubygems_version: 3.5.3
212
+ rubygems_version: 3.5.11
212
213
  signing_key:
213
214
  specification_version: 4
214
215
  summary: CZMQ FFI binding to bring ZMQ sockets to Ruby