cztop-reactor 0.8.0 → 0.9.0

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: ead3b23a272e3e970d8a951b1eb32ee312076363965fb3d423ac81c9eecf4be6
4
- data.tar.gz: f9f8024946fee7172468c8716fc87fc3e953e86697f6b568b86f1d08c05306ff
3
+ metadata.gz: 22ca99dbae54301ef1f95d2eacca5655259668f3a8a7954417d07a18e697ff66
4
+ data.tar.gz: '0924373dc3ab919d71c9198d96a6bc689136f1c7e9c5c5f5fdade21bdaeff480'
5
5
  SHA512:
6
- metadata.gz: ce8274021e57515e5dcc260f536fe0c4ac9f3adb0e107dfbd4505e1ce2736c4606690eba22be75dabac5d3a0633cad88071cb23e8eb80dcb1606989e86aeb787
7
- data.tar.gz: a9afef7f4b16eab396785f8c541837586a485f9942f0ad9f8f06cb4f14b75a452e32683ca6561df83477cdc065001d85099e5bc0c7cda9c70f8cbb6e6ac35f95
6
+ metadata.gz: cddbc24432bfe9094e2f445a16a773e0718828fe0d1a9c173292b7a41a96fddaa26de8505208819ab3a498f43446ff53a965a8ce4bbc0bcea5b8d80fa0dd06cc
7
+ data.tar.gz: a4e834baa6c8d28ea880b93db9823baf3b5eed900b0b61f728be499c9097ef7cb17118faef599d4b0ba6f784937ec16543dd5f6c3427306b93c00407594ecbcb
Binary file
data.tar.gz.sig CHANGED
Binary file
data/History.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## v0.9.0 [2019-07-10] Michael Granger <ged@FaerieMUD.org>
2
+
3
+ Improvements
4
+
5
+ - Fix a bug in signal handling
6
+ - Work around CZTop's mapping of EINTR in a poller_wait to an Interrupt
7
+
8
+
1
9
  ## v0.8.0 [2019-05-22] Michael Granger <ged@FaerieMUD.org>
2
10
 
3
11
  Bugfixes:
@@ -24,7 +24,7 @@ class CZTop::Reactor
24
24
  include MonitorMixin
25
25
 
26
26
  # The version of this library
27
- VERSION = '0.8.0'
27
+ VERSION = '0.9.0'
28
28
 
29
29
  # The maximum number of seconds to wait for events when there are no timers
30
30
  # registered.
@@ -36,6 +36,14 @@ class CZTop::Reactor
36
36
  write: CZTop::Poller::ZMQ::POLLOUT,
37
37
  }.freeze
38
38
 
39
+ # Errors encountered during the poll that should retry instead of raising
40
+ POLLER_RETRY_ERRORS = [
41
+ Errno::EINTR::Errno, # CZTop maps this to Interrupt, but it can be *any*
42
+ # signal, not just SIGINT
43
+ Errno::EAGAIN::Errno,
44
+ Errno::ETIMEDOUT::Errno,
45
+ ]
46
+
39
47
 
40
48
  autoload :Event, 'cztop/reactor/event'
41
49
 
@@ -393,7 +401,10 @@ class CZTop::Reactor
393
401
  def wait( timeout=-1 )
394
402
  rc = CZTop::Poller::ZMQ.poller_wait( @poller_ptr, @event_ptr, timeout )
395
403
  if rc == -1
396
- if CZMQ::FFI::Errors.errno != Errno::ETIMEDOUT::Errno
404
+ case CZMQ::FFI::Errors.errno
405
+ when *POLLER_RETRY_ERRORS
406
+ # Retry if the error means we should
407
+ else
397
408
  CZTop::HasFFIDelegate.raise_zmq_err
398
409
  end
399
410
  return nil
@@ -118,7 +118,8 @@ module CZTop::Reactor::SignalHandling
118
118
 
119
119
 
120
120
  ### Look for any signals that arrived and handle them.
121
- def handle_queued_signals( _event )
121
+ def handle_queued_signals( event )
122
+ event.socket.wait
122
123
  while sig = Thread.main[ SIGNAL_QUEUE_KEY ].shift
123
124
  self.log.debug " got a queued signal: %p" % [ sig ]
124
125
  self.handle_signal( sig )
@@ -364,6 +364,16 @@ describe CZTop::Reactor do
364
364
  end
365
365
 
366
366
 
367
+ it "ignores EINTR by default" do
368
+ expect( CZTop::Poller::ZMQ ).to receive( :poller_wait ).
369
+ and_return( -1 )
370
+ expect( CZMQ::FFI::Errors ).to receive( :errno ).
371
+ and_return( Errno::EINTR::Errno )
372
+
373
+ expect( reactor.poll_once ).to be_nil
374
+ end
375
+
376
+
367
377
  it "has an option to propagate EGAIN/EWOULDBLOCK" do
368
378
  expect( CZTop::Poller::ZMQ ).to receive( :poller_wait ).
369
379
  and_raise( Errno::EAGAIN.new )
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cztop-reactor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Granger
@@ -34,7 +34,7 @@ cert_chain:
34
34
  v4qqqa27Bs468d6SoPxjSm8a2mM9HZ4OdWhq4tFsbTeXDVquCfi64OTEaTt2xQdR
35
35
  JnC4lpJfCP6aCXa5h2XAQfPSH636cQap
36
36
  -----END CERTIFICATE-----
37
- date: 2019-05-22 00:00:00.000000000 Z
37
+ date: 2019-10-09 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: loggability
@@ -174,14 +174,14 @@ dependencies:
174
174
  requirements:
175
175
  - - "~>"
176
176
  - !ruby/object:Gem::Version
177
- version: '3.17'
177
+ version: '3.18'
178
178
  type: :development
179
179
  prerelease: false
180
180
  version_requirements: !ruby/object:Gem::Requirement
181
181
  requirements:
182
182
  - - "~>"
183
183
  - !ruby/object:Gem::Version
184
- version: '3.17'
184
+ version: '3.18'
185
185
  description: |-
186
186
  This is an implementation of the Reactor pattern described in [Pattern-Oriented
187
187
  Software Architecture (Volume 2)][POSA2]. It allows an asynchronous application
@@ -250,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
250
250
  - !ruby/object:Gem::Version
251
251
  version: '0'
252
252
  requirements: []
253
- rubygems_version: 3.0.3
253
+ rubygems_version: 3.0.6
254
254
  signing_key:
255
255
  specification_version: 4
256
256
  summary: This is an implementation of the Reactor pattern described in [Pattern-Oriented
metadata.gz.sig CHANGED
Binary file