cztop 1.2.3 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5d76545700369dac81459715b642249b0b12460a7307e15454800a373feeea0f
4
- data.tar.gz: 978a64afa33b8d8ca3f38a1e9f6fc115cee1ba64da8ad6b56eb705392007543f
3
+ metadata.gz: c158b4eded1b181765d923d869fc6b9f959313f7640bfc3dc8b47b113dcf4d5c
4
+ data.tar.gz: afcca2379f96a9569f1776938873767fcbaaa78ec3a08faf2f860b17b42b6f34
5
5
  SHA512:
6
- metadata.gz: e7bc28d173c43d80379a0e41bc041f8b942aecd3378c3fbe29995c1b9d2d03657ea11c43bbaf4f3781f1ab0f9778e089c4dd76db9ec27419281550d20dd890e1
7
- data.tar.gz: 89c5d43a8aab9e10250257592b91f6c8362be08cd5ae66d4b4a5db408f5b58d2c1fd0408e8529c66f0392d169bb6b8e82ca6e6278f88574427e36d00b4e492e2
6
+ metadata.gz: f4ab7318be7ef914957517c7dc8bb9d4030faa89b86de08479d5ad4fcc63b544745f19d0945d119898a378855f51039788f89df0dd3b9994ec2801100d5f31c3
7
+ data.tar.gz: 3d68e63fb44e994bcac69c76855991c8f71a4c275f76c9afcd728ccc3d3e906d1f25359bf36861136ac8252e6b433bcbec81047217a18052900a7ae3e302f0ce
data/CHANGES.md CHANGED
@@ -1,3 +1,8 @@
1
+ 1.2.4 (1/16/2024)
2
+ -----
3
+ * PolymorphicZsockMethods#wait: fail with NotImplementedError inside non-blocking Fibers
4
+ * fail with ArgumentError when sending message with no parts
5
+
1
6
  1.2.3 (1/7/2024)
2
7
  -----
3
8
  * no changes, just re-release to update README on https://www.rubydoc.info/gems/cztop
data/cztop.gemspec CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  spec.license = "ISC"
15
15
  spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
16
16
 
17
- spec.metadata["homepage_uri"] = spec.homepage
17
+ spec.metadata["homepage_uri"] = "https://github.com/paddor/cztop"
18
18
  spec.metadata["source_code_uri"] = "https://github.com/paddor/cztop"
19
19
  spec.metadata["changelog_uri"] = "https://github.com/paddor/cztop/blob/master/CHANGES.md"
20
20
 
data/lib/cztop/actor.rb CHANGED
@@ -37,7 +37,7 @@ module CZTop
37
37
  class Actor
38
38
 
39
39
  include HasFFIDelegate
40
- extend CZTop::HasFFIDelegate::ClassMethods
40
+ extend HasFFIDelegate::ClassMethods
41
41
  include ZsockOptions
42
42
  include SendReceiveMethods
43
43
  include PolymorphicZsockMethods
@@ -6,7 +6,7 @@ module CZTop
6
6
  # @return [Integer] number of frames
7
7
  # @see content_size
8
8
  def size
9
- frames.count
9
+ ffi_delegate.size
10
10
  end
11
11
 
12
12
 
data/lib/cztop/message.rb CHANGED
@@ -32,7 +32,7 @@ module CZTop
32
32
  end
33
33
 
34
34
 
35
- # @return [Boolean] if this message is empty or not
35
+ # @return [Boolean] if this message is empty or not (no frames or every frame has length zero)
36
36
  def empty?
37
37
  content_size.zero?
38
38
  end
@@ -56,11 +56,13 @@ module CZTop
56
56
  # corresponding
57
57
  # to the given routing ID)
58
58
  # @raise [ArgumentError] if the message is invalid, e.g. when trying to
59
- # send a multi-part message over a CLIENT/SERVER socket
59
+ # send a message with a no parts, or a multi-part message over a CLIENT/SERVER socket
60
60
  # @raise [SystemCallError] for any other error code set after +zmsg_send+
61
61
  # returns with failure. Please report as bug.
62
62
  #
63
63
  def send_to(destination)
64
+ fail ArgumentError, "message has no frames" if size.zero?
65
+
64
66
  destination.wait_writable
65
67
 
66
68
  rc = Zmsg.send(ffi_delegate, destination)
@@ -14,7 +14,10 @@ module CZTop
14
14
 
15
15
  # Waits for a signal.
16
16
  # @return [Integer] the received signal
17
+ # @note This will block and is therefore not compatible with {Fiber.scheduler} (e.g. Async).
17
18
  def wait
19
+ fail NotImplementedError if !Fiber.blocking?
20
+
18
21
  ::CZMQ::FFI::Zsock.wait(ffi_delegate)
19
22
  end
20
23
 
data/lib/cztop/socket.rb CHANGED
@@ -5,7 +5,7 @@ module CZTop
5
5
  class Socket
6
6
 
7
7
  include HasFFIDelegate
8
- extend CZTop::HasFFIDelegate::ClassMethods
8
+ extend HasFFIDelegate::ClassMethods
9
9
  include ZsockOptions
10
10
  include SendReceiveMethods
11
11
  include PolymorphicZsockMethods
data/lib/cztop/version.rb CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  module CZTop
4
4
 
5
- VERSION = '1.2.3'
5
+ VERSION = '1.2.4'
6
6
 
7
7
  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.3
4
+ version: 1.2.4
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-07 00:00:00.000000000 Z
11
+ date: 2024-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: czmq-ffi-gen
@@ -190,7 +190,7 @@ homepage: https://rubygems.org/gems/cztop
190
190
  licenses:
191
191
  - ISC
192
192
  metadata:
193
- homepage_uri: https://rubygems.org/gems/cztop
193
+ homepage_uri: https://github.com/paddor/cztop
194
194
  source_code_uri: https://github.com/paddor/cztop
195
195
  changelog_uri: https://github.com/paddor/cztop/blob/master/CHANGES.md
196
196
  post_install_message: