async-container 0.32.0 → 0.33.0

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: 063a67f14c61853591e2391b2d4a9c4fcde57c6f2267863cbcf7da92844d4755
4
- data.tar.gz: ee0b57cf4ab296c3756d997d74a2a194303471a2608967f8790f39881615e564
3
+ metadata.gz: 540ced6fa47f3b7a289c62b426b58e9bf0269573eec8b886ce3a97748e2050fe
4
+ data.tar.gz: 188bd801df86b8819989f679e66a4036761a77fe3f438e7121f065cb932c087a
5
5
  SHA512:
6
- metadata.gz: 3626a193d3d97014df421b540f8e75516dd8745c6ebbdd95fe88addfaf1dabda4f0a2de88049ec13124656a2c5f30e5448441dab137465ec950f1cb5a4c9978c
7
- data.tar.gz: 2a5f8f5acbf9ca9667cf837f5344568b879faa77ac3f4f15aad8fe97fa61f1b9e6b87af193776884bedb89526735b8f15c0e13c5bb884cef0d42e5c0465e876f
6
+ metadata.gz: 9da0dde241b6b11e5635e4dc899ea3112b64d789602f5d76a26d7596fad0d63596c8e3ffe7dd209a254ea3b8e27693d2345e9725d86bf3bcb5af5630dedd29bb
7
+ data.tar.gz: 27db38943290ce92173ec0df1262f8803032f0068ad0ca17c5551d919f5a71d6f555bbc5be9b6d074df9bd23da94da8be042d13d24e4755b606087543167d93b
checksums.yaml.gz.sig CHANGED
Binary file
@@ -24,19 +24,30 @@ module Async
24
24
  # Initialize the controller.
25
25
  # @parameter notify [Notify::Client] A client used for process readiness notifications.
26
26
  def initialize(notify: Notify.open!, container_class: Container, graceful_stop: true)
27
- @container = nil
27
+ @notify = notify
28
28
  @container_class = container_class
29
+ @graceful_stop = graceful_stop
29
30
 
30
- @notify = notify
31
+ @container = nil
31
32
  @signals = {}
32
33
 
33
34
  self.trap(SIGHUP) do
34
35
  self.restart
35
36
  end
36
-
37
- @graceful_stop = graceful_stop
38
37
  end
39
38
 
39
+ # The notify client used by the controller.
40
+ attr :notify
41
+
42
+ # The container class used by the controller.
43
+ attr :container_class
44
+
45
+ # The graceful stop flag used by the controller.
46
+ attr :graceful_stop
47
+
48
+ # The current container being managed by the controller.
49
+ attr :container
50
+
40
51
  # The state of the controller.
41
52
  # @returns [String]
42
53
  def state_string
@@ -60,9 +71,6 @@ module Async
60
71
  @signals[signal] = block
61
72
  end
62
73
 
63
- # The current container being managed by the controller.
64
- attr :container
65
-
66
74
  # Create a policy for managing child lifecycle events.
67
75
  # Can be overridden by a sub-class to provide a custom policy.
68
76
  # @returns [Policy] The policy to use for the container.
@@ -51,9 +51,9 @@ module Async
51
51
 
52
52
  @state = {}
53
53
 
54
- @statistics = Statistics.new
55
- @keyed = {}
56
54
  @policy = policy
55
+ @statistics = @policy.make_statistics
56
+ @keyed = {}
57
57
  end
58
58
 
59
59
  # @attribute [Group] The group of running children instances.
@@ -92,6 +92,13 @@ module Async
92
92
  status&.exitstatus
93
93
  end
94
94
 
95
+ # Create statistics for a container.
96
+ # Can be overridden by subclasses to customize the statistics window.
97
+ # @returns [Statistics] A new statistics instance.
98
+ def make_statistics
99
+ Statistics.new
100
+ end
101
+
95
102
  # The default policy instance.
96
103
  DEFAULT = self.new.freeze
97
104
  end
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Async
7
7
  module Container
8
- VERSION = "0.32.0"
8
+ VERSION = "0.33.0"
9
9
  end
10
10
  end
data/readme.md CHANGED
@@ -28,6 +28,14 @@ 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.33.0
32
+
33
+ - Add `Policy#make_statistics` to allow policies to customize statistics initialization.
34
+
35
+ ### v0.32.1
36
+
37
+ - Expose `Async::Container::Controller` `#notify`, `#container_class`, and `#graceful_stop` for testing.
38
+
31
39
  ### v0.32.0
32
40
 
33
41
  - Minor **breaking** changes to `Async::Container::Policy` interface.
@@ -66,14 +74,6 @@ Please see the [project releases](https://socketry.github.io/async-container/rel
66
74
  - Add log for starting child, including container statistics.
67
75
  - Don't try to (log) "terminate 0 child processes" if there are none.
68
76
 
69
- ### v0.27.2
70
-
71
- - More logging, especially around failure cases.
72
-
73
- ### v0.27.1
74
-
75
- - Log caller and timeout when waiting on a child instance to exit, if it blocks.
76
-
77
77
  ## Contributing
78
78
 
79
79
  We welcome contributions to this project.
data/releases.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Releases
2
2
 
3
+ ## v0.33.0
4
+
5
+ - Add `Policy#make_statistics` to allow policies to customize statistics initialization.
6
+
7
+ ## v0.32.1
8
+
9
+ - Expose `Async::Container::Controller` `#notify`, `#container_class`, and `#graceful_stop` for testing.
10
+
3
11
  ## v0.32.0
4
12
 
5
13
  - Minor **breaking** changes to `Async::Container::Policy` interface.
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.32.0
4
+ version: 0.33.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file