goru 0.4.0 → 0.4.2

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: a1bad5e42a7c84e99e1e75651c62f0c2459497aacafea49319279d8de5251c9c
4
- data.tar.gz: 4c6a172e82892ce4301482d42fe03c59b299e6409efbc1bd620aacaf2bc24301
3
+ metadata.gz: e51ea3837c3867f3454c5c4794a9a9aca28a5d8e72b199a616a6fe450294e0af
4
+ data.tar.gz: a7efb9761602db2224ddf2d8c48ba9c89d0e3c872f4b880a6dc4fec7633d4068
5
5
  SHA512:
6
- metadata.gz: 9dbcc82cce20117208062ac716097982b96ad59bec1fa6a3326f5703ea47529c7afb2ddf9531d81b0b237d77a13aab253494c74da5c8312eb166bde150525707
7
- data.tar.gz: a6259dac811fabfd7791319d09e3ddf228b8b8a7f3f73e829fcd1b29630eae52e2c503a5682c7b3ac269068464947da2254343e0f0743ee0111284f87d9a284c
6
+ metadata.gz: 8f926d07bd70647ea0b05c3eb78244e234174ba0b720bf13e40178674bb2189e1fffd562a8ae2f7df3f39c86fc2612762caf9e29a3e19128f4dabd510cc08e49
7
+ data.tar.gz: 025ec84977d4c997f4578a15934420d7060656512b8ba46e02f8b768cd42ec0cf56488234985b0a4d074003f9e0ca1e6e2ce144544b48c123344e7b52c6e31a2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## [v0.4.2](https://github.com/bryanp/goru/releases/tag/v0.4.2)
2
+
3
+ *released on 2023-09-17*
4
+
5
+ * `fix` [#24](https://github.com/bryanp/goru/pull/24) Close the io object when the routine is finished ([bryanp](https://github.com/bryanp))
6
+ * `fix` [#25](https://github.com/bryanp/goru/pull/25) Handle IOError in the scheduler and reactor ([bryanp](https://github.com/bryanp))
7
+
8
+ ## [v0.4.1](https://github.com/bryanp/goru/releases/tag/v0.4.1)
9
+
10
+ *released on 2023-07-29*
11
+
12
+ * `fix` [#23](https://github.com/bryanp/goru/pull/23) Handle `IOError` in io routines ([bryanp](https://github.com/bryanp))
13
+
1
14
  ## [v0.4.0](https://github.com/bryanp/goru/releases/tag/v0.4.0)
2
15
 
3
16
  *released on 2023-07-16*
data/lib/goru/channel.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "./reactor"
3
+ require_relative "reactor"
4
4
 
5
5
  module Goru
6
6
  class Channel
data/lib/goru/reactor.rb CHANGED
@@ -108,6 +108,7 @@ module Goru
108
108
  end
109
109
 
110
110
  @timers.fire
111
+ rescue IOError
111
112
  end
112
113
 
113
114
  private def wait(timeout: nil)
@@ -68,8 +68,9 @@ module Goru
68
68
  rescue Errno::EAGAIN
69
69
  wait
70
70
  rescue Errno::ECONNRESET, Errno::EPIPE, EOFError
71
- finished
72
- nil
71
+ handle_io_unavailable
72
+ rescue IOError
73
+ handle_io_unavailable
73
74
  end
74
75
 
75
76
  def wait
@@ -86,8 +87,9 @@ module Goru
86
87
  rescue Errno::EAGAIN
87
88
  wait
88
89
  rescue Errno::ECONNRESET, Errno::EPIPE, EOFError
89
- finished
90
- nil
90
+ handle_io_unavailable
91
+ rescue IOError
92
+ handle_io_unavailable
91
93
  end
92
94
 
93
95
  # [public]
@@ -97,6 +99,12 @@ module Goru
97
99
  rescue Errno::EAGAIN
98
100
  wait
99
101
  rescue Errno::ECONNRESET, Errno::EPIPE, EOFError
102
+ handle_io_unavailable
103
+ rescue IOError
104
+ handle_io_unavailable
105
+ end
106
+
107
+ private def handle_io_unavailable
100
108
  finished
101
109
  nil
102
110
  end
@@ -153,6 +161,13 @@ module Goru
153
161
  @reactor.wakeup
154
162
  end
155
163
 
164
+ # [public]
165
+ #
166
+ def finished(...)
167
+ @io.close
168
+ super
169
+ end
170
+
156
171
  private def status_changed
157
172
  case @status
158
173
  when Routine::STATUS_FINISHED
@@ -50,6 +50,7 @@ module Goru
50
50
  Thread.new {
51
51
  Thread.handle_interrupt(Interrupt => :never) do
52
52
  reactor.run
53
+ rescue IOError
53
54
  end
54
55
  }
55
56
  }
data/lib/goru/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Goru
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.2"
5
5
 
6
6
  # [public]
7
7
  #
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: goru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Powell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-16 00:00:00.000000000 Z
11
+ date: 2023-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: core-extension
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  - !ruby/object:Gem::Version
122
122
  version: '0'
123
123
  requirements: []
124
- rubygems_version: 3.4.12
124
+ rubygems_version: 3.4.17
125
125
  signing_key:
126
126
  specification_version: 4
127
127
  summary: Concurrent routines for Ruby.