cztop 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +5 -0
- data/README.md +0 -2
- data/cztop.gemspec +2 -5
- data/lib/cztop/has_ffi_delegate.rb +11 -9
- data/lib/cztop/send_receive_methods.rb +14 -2
- data/lib/cztop/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecc7b2951190994c49a1fe184641bc8933b0564dce1bdf00a346b491d67f5810
|
4
|
+
data.tar.gz: 0d54b8a9bd48d08ca734a5aee4a5317c13aa1a7f2b620fa036dbde8c61b98eb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9f762a7ed4509bef25d4f995fd8ed7bcbe40ea67b829eda881d3973b5656ba9c72eb485b56916edddd112006e804d21f74eb17d016d50764db1ef35f7de0c2a
|
7
|
+
data.tar.gz: d2a876b9478e43c322e10388ac929d8cc97bcf5a9e19d9b4a67b1e042b2830165ff16d7721334c22ebb42172819b7e9397854123d90908ff8eeaffb0e3055565
|
data/CHANGES.md
CHANGED
data/README.md
CHANGED
@@ -117,8 +117,6 @@ At least:
|
|
117
117
|
|
118
118
|
* Ruby 3.0, 3.1, 3.2, 3.3
|
119
119
|
|
120
|
-
Using CZTop with Async will require Ruby 3.2 because of the use of `IO::TimeoutError`, which was introduced in Ruby 3.2.
|
121
|
-
|
122
120
|
## Installation
|
123
121
|
|
124
122
|
To use this gem, add this line to your application's Gemfile:
|
data/cztop.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.description = 'CZMQ binding based on the generated low-level FFI bindings of CZMQ'
|
13
13
|
spec.homepage = "https://rubygems.org/gems/cztop"
|
14
14
|
spec.license = "ISC"
|
15
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 3.
|
15
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
|
16
16
|
|
17
17
|
spec.metadata["homepage_uri"] = spec.homepage
|
18
18
|
spec.metadata["source_code_uri"] = "https://github.com/paddor/cztop"
|
@@ -32,8 +32,5 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_development_dependency "rspec-given", "~> 3.8.0"
|
33
33
|
spec.add_development_dependency "pry"
|
34
34
|
spec.add_development_dependency "yard"
|
35
|
-
|
36
|
-
if RUBY_VERSION >= '3.1'
|
37
|
-
spec.add_development_dependency "async", ">= 2.0.1"
|
38
|
-
end
|
35
|
+
spec.add_development_dependency "async"
|
39
36
|
end
|
@@ -52,16 +52,18 @@ module CZTop::HasFFIDelegate
|
|
52
52
|
# SystemCallError subclass, if errno is known)
|
53
53
|
def raise_zmq_err(msg = CZMQ::FFI::Errors.strerror,
|
54
54
|
errno: CZMQ::FFI::Errors.errno)
|
55
|
-
|
56
55
|
case errno
|
57
|
-
when Errno::EINVAL::Errno
|
58
|
-
|
59
|
-
when Errno::
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
56
|
+
when Errno::EINVAL::Errno
|
57
|
+
fail ArgumentError, msg, caller
|
58
|
+
when Errno::EINTR::Errno
|
59
|
+
fail Interrupt, msg, caller
|
60
|
+
when Errno::EHOSTUNREACH::Errno
|
61
|
+
fail SocketError, msg, caller
|
62
|
+
else
|
63
|
+
# If the errno is known, the corresponding Errno::* exception is
|
64
|
+
# automatically constructed. Otherwise, it'll be a plain SystemCallError.
|
65
|
+
# In any case, #errno will return the corresponding errno.
|
66
|
+
fail SystemCallError.new(msg, errno), msg, caller
|
65
67
|
end
|
66
68
|
end
|
67
69
|
|
@@ -1,5 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# Support Ruby < 3.2
|
4
|
+
unless defined? IO::TimeoutError
|
5
|
+
class IO::TimeoutError < IOError
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
3
9
|
module CZTop
|
4
10
|
# These are methods that can be used on a {Socket} as well as an {Actor},
|
5
11
|
# but actually just pass through to methods of {Message} (which take
|
@@ -52,6 +58,7 @@ module CZTop
|
|
52
58
|
timeout_at = now + timeout
|
53
59
|
|
54
60
|
while true
|
61
|
+
# p wait_readable: self, timeout: timeout
|
55
62
|
@fd_io.wait_readable(timeout)
|
56
63
|
break if readable? # NOTE: ZMQ FD can't be trusted
|
57
64
|
raise ::IO::TimeoutError if now >= timeout_at
|
@@ -60,8 +67,10 @@ module CZTop
|
|
60
67
|
sleep JIFFY
|
61
68
|
end
|
62
69
|
else
|
63
|
-
|
70
|
+
while true
|
71
|
+
# p wait_readable: self
|
64
72
|
@fd_io.wait_readable
|
73
|
+
break if readable? # NOTE: ZMQ FD can't be trusted
|
65
74
|
|
66
75
|
# HACK for edge case: avoid hogging CPU if FD for socket type doesn't block and just insists
|
67
76
|
sleep JIFFY
|
@@ -85,6 +94,7 @@ module CZTop
|
|
85
94
|
timeout_at = now + timeout
|
86
95
|
|
87
96
|
while true
|
97
|
+
# p wait_writable: self, timeout: timeout
|
88
98
|
@fd_io.wait_writable(timeout)
|
89
99
|
break if writable? # NOTE: ZMQ FD can't be trusted
|
90
100
|
raise ::IO::TimeoutError if now >= timeout_at
|
@@ -93,8 +103,10 @@ module CZTop
|
|
93
103
|
sleep JIFFY
|
94
104
|
end
|
95
105
|
else
|
96
|
-
|
106
|
+
while true
|
107
|
+
# p wait_writable: self
|
97
108
|
@fd_io.wait_writable
|
109
|
+
break if writable? # NOTE: ZMQ FD can't be trusted
|
98
110
|
|
99
111
|
# HACK for edge case: avoid hogging CPU if FD for socket type doesn't block and just insists
|
100
112
|
sleep JIFFY
|
data/lib/cztop/version.rb
CHANGED
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: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrik Wenger
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
131
|
+
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
138
|
+
version: '0'
|
139
139
|
description: CZMQ binding based on the generated low-level FFI bindings of CZMQ
|
140
140
|
email:
|
141
141
|
- paddor@gmail.com
|
@@ -201,7 +201,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
201
201
|
requirements:
|
202
202
|
- - ">="
|
203
203
|
- !ruby/object:Gem::Version
|
204
|
-
version: 3.
|
204
|
+
version: 3.0.0
|
205
205
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
206
206
|
requirements:
|
207
207
|
- - ">="
|