async-container 0.24.0 → 0.25.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: d8b5dae742b5445c83c515d4745a49df725f9eea920e43340913b19239af8aa6
4
- data.tar.gz: b4153930bb6ee37055e5675c921193ec27221c754ced2250975a2ba13fb0fda8
3
+ metadata.gz: e2613c963c3efb08cf02c6a6299668b2b9ed83b583bbe84ebc973fa099b62e4a
4
+ data.tar.gz: 9cc9cd1ac55d85be9684e9a042be6ff3e93dd44e69c2ce212ec5f7441cbf7b1d
5
5
  SHA512:
6
- metadata.gz: 76a94fbd31a24ac6b6dccd52cde65bee5da8ec4e7fedb87493ffa4b67f64de387d88ddf7bff2edcec4e2075d928d52ed0273ffd6315cde69f8350d3e902a7db8
7
- data.tar.gz: 424b331952bc76e338c21288fc710575bd651061ebcc8c5522b0c3aa4f3f4603726afdf75febba5e4ca6242d182d07603bed81043af14814ef7b397659ca3961
6
+ metadata.gz: ca31eb9ecbdd3c343ec77621778bcf7cfba210b5a1b7ba05a02d0e590f3574c8e0e25a4bcb85be5a6af05a601874084a2fab94dd2c422073c588816c899c7f46
7
+ data.tar.gz: 6ade195ca0f67619dbffee9b6f4dd6d567ccd05b2dd069075a10403c897806c1f33c3f44b06ef91a5ea5212b85c4cbf4c3a8f1ca4e02988a9559781c991e884f
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2017-2024, by Samuel Williams.
4
+ # Copyright, 2017-2025, by Samuel Williams.
5
5
 
6
6
  require_relative "error"
7
7
 
@@ -189,6 +189,7 @@ module Async
189
189
  "\#<#{self.class} name=#{@name.inspect} status=#{@status.inspect} pid=#{@pid.inspect}>"
190
190
  end
191
191
 
192
+ # @returns [String] A string representation of the process.
192
193
  alias to_s inspect
193
194
 
194
195
  # Invoke {#terminate!} and then {#wait} for the child process to exit.
@@ -236,7 +237,7 @@ module Async
236
237
  Console.debug(self, "Waiting for process to exit...", pid: @pid)
237
238
 
238
239
  _, @status = ::Process.wait2(@pid, ::Process::WNOHANG)
239
-
240
+
240
241
  while @status.nil?
241
242
  sleep(0.1)
242
243
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2024, by Samuel Williams.
4
+ # Copyright, 2019-2025, by Samuel Williams.
5
5
 
6
6
  require "etc"
7
7
  require "async/clock"
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2018-2024, by Samuel Williams.
4
+ # Copyright, 2018-2025, by Samuel Williams.
5
5
 
6
6
  require "fiber"
7
7
  require "async/clock"
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2024, by Samuel Williams.
4
+ # Copyright, 2019-2025, by Samuel Williams.
5
5
  # Copyright, 2022, by Anton Sozontov.
6
6
 
7
7
  require_relative "forked"
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2020-2022, by Samuel Williams.
4
+ # Copyright, 2020-2025, by Samuel Williams.
5
5
 
6
6
  module Async
7
7
  module Container
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2020-2022, by Samuel Williams.
4
+ # Copyright, 2020-2025, by Samuel Williams.
5
5
 
6
6
  module Async
7
7
  module Container
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2020-2024, by Samuel Williams.
4
+ # Copyright, 2025, by Samuel Williams.
5
5
 
6
6
  require_relative "client"
7
7
  require "socket"
@@ -14,9 +14,16 @@ module Async
14
14
  # The name of the environment variable which contains the path to the notification socket.
15
15
  NOTIFY_LOG = "NOTIFY_LOG"
16
16
 
17
+ # @returns [String] The path to the notification log file.
18
+ # @parameter environment [Hash] The environment variables, defaults to `ENV`.
19
+ def self.path(environment = ENV)
20
+ environment[NOTIFY_LOG]
21
+ end
22
+
17
23
  # Open a notification client attached to the current {NOTIFY_LOG} if possible.
24
+ # @parameter environment [Hash] The environment variables, defaults to `ENV`.
18
25
  def self.open!(environment = ENV)
19
- if path = environment.delete(NOTIFY_LOG)
26
+ if path = self.path(environment)
20
27
  self.new(path)
21
28
  end
22
29
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2020-2024, by Samuel Williams.
4
+ # Copyright, 2020-2025, by Samuel Williams.
5
5
  # Copyright, 2020, by Juan Antonio Martín Lucas.
6
6
 
7
7
  require_relative "client"
@@ -42,18 +42,18 @@ module Async
42
42
  if notify_pipe = options.delete(:notify_pipe)
43
43
  options[notify_pipe] = @io
44
44
  environment[NOTIFY_PIPE] = notify_pipe.to_s
45
-
45
+
46
46
  # Use stdout if it's not redirected:
47
47
  # This can cause issues if the user expects stdout to be connected to a terminal.
48
48
  # elsif !options.key?(:out)
49
49
  # options[:out] = @io
50
50
  # environment[NOTIFY_PIPE] = "1"
51
-
51
+
52
52
  # Use fileno 3 if it's available:
53
53
  elsif !options.key?(3)
54
54
  options[3] = @io
55
55
  environment[NOTIFY_PIPE] = "3"
56
-
56
+
57
57
  # Otherwise, give up!
58
58
  else
59
59
  raise ArgumentError, "Please specify valid file descriptor for notify_pipe!"
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2020-2024, by Samuel Williams.
4
+ # Copyright, 2020-2025, by Samuel Williams.
5
5
  # Copyright, 2020, by Olle Jonsson.
6
6
 
7
7
  require "tmpdir"
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2020-2024, by Samuel Williams.
4
+ # Copyright, 2020-2025, by Samuel Williams.
5
5
 
6
6
  require_relative "client"
7
7
  require "socket"
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2020-2024, by Samuel Williams.
4
+ # Copyright, 2020-2025, by Samuel Williams.
5
5
 
6
6
  require_relative "notify/pipe"
7
7
  require_relative "notify/socket"
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2024, by Samuel Williams.
4
+ # Copyright, 2019-2025, by Samuel Williams.
5
5
 
6
6
  require "async/reactor"
7
7
 
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2017-2024, by Samuel Williams.
4
+ # Copyright, 2017-2025, by Samuel Williams.
5
5
 
6
6
  module Async
7
7
  module Container
8
- VERSION = "0.24.0"
8
+ VERSION = "0.25.0"
9
9
  end
10
10
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2017-2024, by Samuel Williams.
4
+ # Copyright, 2017-2025, by Samuel Williams.
5
5
 
6
6
  require_relative "container/controller"
7
7
 
data/readme.md CHANGED
@@ -18,10 +18,22 @@ Please see the [project documentation](https://socketry.github.io/async-containe
18
18
 
19
19
  - [Getting Started](https://socketry.github.io/async-container/guides/getting-started/index) - This guide explains how to use `async-container` to build basic scalable systems.
20
20
 
21
+ - [Systemd Integration](https://socketry.github.io/async-container/guides/systemd-integration/index) - This guide explains how to use `async-container` with systemd to manage your application as a service.
22
+
23
+ - [Kubernetes Integration](https://socketry.github.io/async-container/guides/kubernetes-integration/index) - This guide explains how to use `async-container` with Kubernetes to manage your application as a containerized service.
24
+
21
25
  ## Releases
22
26
 
23
27
  Please see the [project releases](https://socketry.github.io/async-container/releases/index) for all releases.
24
28
 
29
+ ### v0.25.0
30
+
31
+ - Introduce `async:container:notify:log:ready?` task for detecting process readiness.
32
+
33
+ ### v0.24.0
34
+
35
+ - Add support for health check failure metrics.
36
+
25
37
  ### v0.23.0
26
38
 
27
39
  - [Add support for `NOTIFY_LOG` for Kubernetes readiness probes.](https://socketry.github.io/async-container/releases/index#add-support-for-notify_log-for-kubernetes-readiness-probes.)
data/releases.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Releases
2
2
 
3
+ ## v0.25.0
4
+
5
+ - Introduce `async:container:notify:log:ready?` task for detecting process readiness.
6
+
7
+ ## v0.24.0
8
+
9
+ - Add support for health check failure metrics.
10
+
3
11
  ## v0.23.0
4
12
 
5
13
  ### Add support for `NOTIFY_LOG` for Kubernetes readiness probes.
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.24.0
4
+ version: 0.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -40,7 +40,7 @@ cert_chain:
40
40
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
41
41
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
42
42
  -----END CERTIFICATE-----
43
- date: 2025-03-07 00:00:00.000000000 Z
43
+ date: 1980-01-02 00:00:00.000000000 Z
44
44
  dependencies:
45
45
  - !ruby/object:Gem::Dependency
46
46
  name: async
@@ -98,14 +98,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
98
98
  requirements:
99
99
  - - ">="
100
100
  - !ruby/object:Gem::Version
101
- version: '3.1'
101
+ version: '3.2'
102
102
  required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  requirements:
104
104
  - - ">="
105
105
  - !ruby/object:Gem::Version
106
106
  version: '0'
107
107
  requirements: []
108
- rubygems_version: 3.6.2
108
+ rubygems_version: 3.6.7
109
109
  specification_version: 4
110
110
  summary: Abstract container-based parallelism using threads and processes where appropriate.
111
111
  test_files: []
metadata.gz.sig CHANGED
Binary file