async-container 0.31.1 → 0.32.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: 46675ed8724779375aeccabec88625bb5f404c7f3ace7348c89acd5809133d8f
4
- data.tar.gz: 697d47779954d8856ed75be18c60cb4907fc119c3bcbdecdbb95dcf2d6154d12
3
+ metadata.gz: 063a67f14c61853591e2391b2d4a9c4fcde57c6f2267863cbcf7da92844d4755
4
+ data.tar.gz: ee0b57cf4ab296c3756d997d74a2a194303471a2608967f8790f39881615e564
5
5
  SHA512:
6
- metadata.gz: e3151ea8a4abeaef64fa4b884587b0d0dd4a85ad8e041d5c912762bde0816ab4415e4f8ed7725f86606923f13e6630810e81ae3d74bfdfe4b92b1575ab8b948c
7
- data.tar.gz: 6e07e869a01ecf5039a07de3a9b4a0ae1fce59d0bf498a9faadc3e94d4c3b6dc3bfa049ea166d5efc766e0a3bf4328f7c05f36a685e0acedcf078baa20887315
6
+ metadata.gz: 3626a193d3d97014df421b540f8e75516dd8745c6ebbdd95fe88addfaf1dabda4f0a2de88049ec13124656a2c5f30e5448441dab137465ec950f1cb5a4c9978c
7
+ data.tar.gz: 2a5f8f5acbf9ca9667cf837f5344568b879faa77ac3f4f15aad8fe97fa61f1b9e6b87af193776884bedb89526735b8f15c0e13c5bb884cef0d42e5c0465e876f
checksums.yaml.gz.sig CHANGED
Binary file
@@ -271,7 +271,7 @@ module Async
271
271
 
272
272
  # Notify policy of exit (after statistics are updated):
273
273
  begin
274
- @policy.child_exit(self, child, status: status, name: name, key: key)
274
+ @policy.child_exit(self, child, status, name: name, key: key)
275
275
  rescue => error
276
276
  Console.error(self, "Policy error in child_exit!", exception: error)
277
277
  end
@@ -12,7 +12,8 @@ module Async
12
12
  # @parameter child [Child] The child process.
13
13
  # @parameter name [String] The name of the child.
14
14
  # @parameter key [Symbol] An optional key for the child.
15
- def child_spawn(container, child, name:, key:)
15
+ # @parameter options [Hash] Additional options for future extensibility.
16
+ def child_spawn(container, child, name:, key:, **options)
16
17
  end
17
18
 
18
19
  # Called when a child exits.
@@ -21,7 +22,8 @@ module Async
21
22
  # @parameter status [Process::Status] The exit status.
22
23
  # @parameter name [String] The name of the child.
23
24
  # @parameter key [Symbol] An optional key for the child.
24
- def child_exit(container, child, status:, name:, key:)
25
+ # @parameter options [Hash] Additional options for future extensibility.
26
+ def child_exit(container, child, status, name:, key:, **options)
25
27
  end
26
28
 
27
29
  # Called when a health check fails.
@@ -30,8 +32,9 @@ module Async
30
32
  # @parameter child [Child] The child process.
31
33
  # @parameter age [Numeric] How long the child has been running.
32
34
  # @parameter timeout [Numeric] The health check timeout that was exceeded.
33
- def health_check_failed(container, child, age:, timeout:)
34
- Console.warn(container, "Health check failed!", child: child, age: age, timeout: timeout)
35
+ # @parameter options [Hash] Additional options for future extensibility.
36
+ def health_check_failed(container, child, age:, timeout:, **options)
37
+ Console.warn(self, "Health check failed!", child: child, age: age, timeout: timeout)
35
38
  child.kill!
36
39
  end
37
40
 
@@ -41,8 +44,9 @@ module Async
41
44
  # @parameter child [Child] The child process.
42
45
  # @parameter age [Numeric] How long the child has been running.
43
46
  # @parameter timeout [Numeric] The startup timeout that was exceeded.
44
- def startup_failed(container, child, age:, timeout:)
45
- Console.warn(container, "Startup failed!", child: child, age: age, timeout: timeout)
47
+ # @parameter options [Hash] Additional options for future extensibility.
48
+ def startup_failed(container, child, age:, timeout:, **options)
49
+ Console.warn(self, "Startup failed!", child: child, age: age, timeout: timeout)
46
50
  child.kill!
47
51
  end
48
52
 
@@ -20,6 +20,9 @@ module Async
20
20
  @last_update = Array.new(@window, 0)
21
21
  end
22
22
 
23
+ # The time window in seconds for rate calculations.
24
+ attr :window
25
+
23
26
  # Get the current time in seconds.
24
27
  # @returns [Integer] The current monotonic time in seconds.
25
28
  def now
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Async
7
7
  module Container
8
- VERSION = "0.31.1"
8
+ VERSION = "0.32.0"
9
9
  end
10
10
  end
data/readme.md CHANGED
@@ -28,6 +28,11 @@ 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.32.0
32
+
33
+ - Minor **breaking** changes to `Async::Container::Policy` interface.
34
+ - Expose `Async::Container::Statistics::Rate#window`.
35
+
31
36
  ### v0.31.0
32
37
 
33
38
  - Introduce `Async::Container::Policy` for managing child lifecycle events and implementing custom failure handling strategies.
@@ -69,11 +74,6 @@ Please see the [project releases](https://socketry.github.io/async-container/rel
69
74
 
70
75
  - Log caller and timeout when waiting on a child instance to exit, if it blocks.
71
76
 
72
- ### v0.27.0
73
-
74
- - Increased default interrupt timeout and terminate timeout to 10 seconds each.
75
- - Expose `ASYNC_CONTAINER_INTERRUPT_TIMEOUT` and `ASYNC_CONTAINER_TERMINATE_TIMEOUT` environment variables for configuring default timeouts.
76
-
77
77
  ## Contributing
78
78
 
79
79
  We welcome contributions to this project.
data/releases.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Releases
2
2
 
3
+ ## v0.32.0
4
+
5
+ - Minor **breaking** changes to `Async::Container::Policy` interface.
6
+ - Expose `Async::Container::Statistics::Rate#window`.
7
+
3
8
  ## v0.31.0
4
9
 
5
10
  - Introduce `Async::Container::Policy` for managing child lifecycle events and implementing custom failure handling strategies.
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.31.1
4
+ version: 0.32.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file