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 +4 -4
- data/CHANGES.md +11 -0
- data/CONTRIBUTORS.md +7 -0
- data/lib/cztop/socket/types.rb +0 -20
- data/lib/cztop/version.rb +1 -1
- data/lib/cztop/zsock_options.rb +21 -6
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f69946c755652d803136712eb37943759d0266b68c6cf7be08d87a70c3fa84c9
|
4
|
+
data.tar.gz: 7019a58ab3cfd1ad5670b7ae7a2af5eb27a50b19186e2a7c727de98121cab529
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
data/lib/cztop/socket/types.rb
CHANGED
@@ -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
data/lib/cztop/zsock_options.rb
CHANGED
@@ -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
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
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 =
|
86
|
-
|
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
|
+
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-
|
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.
|
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
|