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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/async/container/controller.rb +1 -1
- data/lib/async/container/generic.rb +0 -2
- data/lib/async/container/group.rb +4 -31
- data/lib/async/container/version.rb +1 -1
- data/readme.md +4 -4
- data/releases.md +4 -0
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1c5506e1e43a28f8d2e9d47e49342821762eaab865a12de832a0517a6675f4de
|
|
4
|
+
data.tar.gz: b36a0515e6621c9cbc26aa749a7b181977d8fc331e2f17fd339004eac812048b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 467d2c01e371653e65b545f0bf8ffcfc41d0551188c62ea2268988b58df5cf33a1221d50dd217046121cfdd793cecf42d92318c0d15016e03691b1add86a6574
|
|
7
|
+
data.tar.gz: 5c3b36fc6d4aa9dcc25408d183e9d3fdd47cd68a58f8e27f13f4ce259226167d3712c176c27eebda9654f7e467fb630dc86ef700ed2e8d7f468418d9857c021e
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
|
@@ -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]
|
|
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
|
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
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
|
Binary file
|