async-container 0.34.0 → 0.34.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0502d4a235533958f93fd6b4791479f056e42761394741af2427bfe027055bc
4
- data.tar.gz: f4c07612adf5e21c1a7b5e86b0be8410e284f9606dad0daa5a4a3da9a94c7237
3
+ metadata.gz: 1c5506e1e43a28f8d2e9d47e49342821762eaab865a12de832a0517a6675f4de
4
+ data.tar.gz: b36a0515e6621c9cbc26aa749a7b181977d8fc331e2f17fd339004eac812048b
5
5
  SHA512:
6
- metadata.gz: 1a29ea78a23485e75e30a6e552bc8dcb18b3361844a8346e57eceec6d0db473747240f3c7818c1d6e6ceeb2cf59ac46d0115c11f13a1fded65dcfbfaef2d0d87
7
- data.tar.gz: 26bbb632a633a15f18a32bd76ada51524e9671123e5d45f17721fb0a5eda22aa88d851f3b32c27272dfcf52279a2729fca909ba980839557ee50abab7426a3e7
6
+ metadata.gz: 467d2c01e371653e65b545f0bf8ffcfc41d0551188c62ea2268988b58df5cf33a1221d50dd217046121cfdd793cecf42d92318c0d15016e03691b1add86a6574
7
+ data.tar.gz: 5c3b36fc6d4aa9dcc25408d183e9d3fdd47cd68a58f8e27f13f4ce259226167d3712c176c27eebda9654f7e467fb630dc86ef700ed2e8d7f468418d9857c021e
checksums.yaml.gz.sig CHANGED
Binary file
@@ -111,7 +111,7 @@ module Async
111
111
  self.restart
112
112
  end
113
113
 
114
- Console.info(self, "Controller started...")
114
+ Console.info(self, "Controller started.")
115
115
  end
116
116
 
117
117
  # Stop the container if it's running.
@@ -170,8 +170,6 @@ module Async
170
170
  rescue => error
171
171
  Console.error(self, "Error while stopping container!", exception: error)
172
172
  raise
173
- ensure
174
- @stopping = false
175
173
  end
176
174
 
177
175
  protected def health_check_failed(child, age_clock, health_check_timeout)
@@ -35,9 +35,6 @@ module Async
35
35
 
36
36
  # The running fibers, indexed by IO:
37
37
  @running = {}
38
-
39
- # This queue allows us to wait for processes to complete, without spawning new processes as a result.
40
- @queue = nil
41
38
  end
42
39
 
43
40
  # @returns [String] A human-readable representation of the group.
@@ -73,16 +70,11 @@ module Async
73
70
 
74
71
  # Sleep for at most the specified duration until some state change occurs.
75
72
  def sleep(duration)
76
- self.resume
77
- self.suspend
78
-
79
73
  self.wait_for_children(duration)
80
74
  end
81
75
 
82
76
  # Begin any outstanding queued processes and wait for them indefinitely.
83
77
  def wait
84
- self.resume
85
-
86
78
  with_health_checks do |duration|
87
79
  self.wait_for_children(duration)
88
80
  end
@@ -239,7 +231,10 @@ module Async
239
231
  # Maybe consider using a proper event loop here:
240
232
  if ready = self.select(duration)
241
233
  ready.each do |io|
242
- @running[io].resume
234
+ if fiber = @running[io]
235
+ # This method can be re-entered. While resuming a fiber, a policy hook may be invoked, which may invoke operations on the container. In that case, select may be called again on the same set of waiting fibers. On returning, those fibers may have already completed and removed themselves from @running, so we need to check for that.
236
+ fiber.resume
237
+ end
243
238
  end
244
239
  end
245
240
  end
@@ -253,28 +248,6 @@ module Async
253
248
  return readable
254
249
  end
255
250
  end
256
-
257
- def yield
258
- if @queue
259
- fiber = Fiber.current
260
-
261
- @queue << fiber
262
- Fiber.yield
263
- end
264
- end
265
-
266
- def suspend
267
- @queue ||= []
268
- end
269
-
270
- def resume
271
- if @queue
272
- queue = @queue
273
- @queue = nil
274
-
275
- queue.each(&:resume)
276
- end
277
- end
278
251
  end
279
252
  end
280
253
  end
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Async
7
7
  module Container
8
- VERSION = "0.34.0"
8
+ VERSION = "0.34.2"
9
9
  end
10
10
  end
data/readme.md CHANGED
@@ -28,6 +28,10 @@ Please see the [project documentation](https://socketry.github.io/async-containe
28
28
 
29
29
  Please see the [project releases](https://socketry.github.io/async-container/releases/index) for all releases.
30
30
 
31
+ ### v0.34.2
32
+
33
+ - Once a container is stopped, it stays stopped.
34
+
31
35
  ### v0.34.0
32
36
 
33
37
  - Add `Async::Container::Generic#stopping?` so that policies can more accurately track the state of the container.
@@ -69,10 +73,6 @@ Please see the [project releases](https://socketry.github.io/async-container/rel
69
73
 
70
74
  - Make the child handling more robust in the face of exceptions.
71
75
 
72
- ### v0.27.4
73
-
74
- - Fix race condition where `wait_for` could modify `@running` while it was being iterated over (`each_value`) during health checks.
75
-
76
76
  ## Contributing
77
77
 
78
78
  We welcome contributions to this project.
data/releases.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Releases
2
2
 
3
+ ## v0.34.2
4
+
5
+ - Once a container is stopped, it stays stopped.
6
+
3
7
  ## v0.34.0
4
8
 
5
9
  - Add `Async::Container::Generic#stopping?` so that policies can more accurately track the state of the container.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-container
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.34.0
4
+ version: 0.34.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file