async-container 0.16.13 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c5d1125f933a88558dd599a529659fa16d23c2d1f6ff6f2db8174637dd00879
4
- data.tar.gz: 224da06065f933827ae175d689067e3eaf632845ba61d9dd74016f7d879a49e4
3
+ metadata.gz: 2f6471fbc90b1e7f77f1309460f4c7e4430b1145e7bed34fd2d3bf0328a07e2c
4
+ data.tar.gz: 2c31a4e9efa968ecb8990ea75635bfc3ae1f7dfbe4206b6924083ff70e41ac22
5
5
  SHA512:
6
- metadata.gz: d1e86aac065481fbae985a9b2876c710407327c37fd5b80dc0e5fe2d42bde88b4b6db97034cc5b150dbb6e8d8446bc49b363dd78af9ad82d5bee411d5a76046e
7
- data.tar.gz: e5fe7ba13b26c65d94a258d9fe2606ce1f51513927958e4542d9ccff3ec8fa285ab0a46692ed520e4049a0a06262ec7383238a5d90f609060661d96e4d1f3ce5
6
+ metadata.gz: e238bdbbd25338102c6e50f94ab061d54ffbe297518ed2700f8e351bb96267e651042bf7a3284c518e6954e7dca5d09c3f1ca4ef043051b4fd128c71c1fe8a42
7
+ data.tar.gz: c3db488f41fab5ccea99a4cc8e89fc6e79cc687b77284f65991712beb51cc8d434e248d419d94fec5aaf04c63c91bfba037243d53c5ba6aa762645244053f04e
checksums.yaml.gz.sig CHANGED
Binary file
@@ -22,8 +22,9 @@ module Async
22
22
 
23
23
  # Initialize the controller.
24
24
  # @parameter notify [Notify::Client] A client used for process readiness notifications.
25
- def initialize(notify: Notify.open!)
25
+ def initialize(notify: Notify.open!, container_class: Container)
26
26
  @container = nil
27
+ @container_class = container_class
27
28
 
28
29
  if @notify = notify
29
30
  @notify.status!("Initializing...")
@@ -66,7 +67,7 @@ module Async
66
67
  # Can be overridden by a sub-class.
67
68
  # @returns [Generic] A specific container instance to use.
68
69
  def create_container
69
- Container.new
70
+ @container_class.new
70
71
  end
71
72
 
72
73
  # Whether the controller has a running container.
@@ -101,6 +102,7 @@ module Async
101
102
  end
102
103
 
103
104
  # Restart the container. A new container is created, and if successful, any old container is terminated gracefully.
105
+ # This is equivalent to a blue-green deployment.
104
106
  def restart
105
107
  if @container
106
108
  @notify&.restarting!
@@ -114,8 +116,8 @@ module Async
114
116
 
115
117
  begin
116
118
  self.setup(container)
117
- rescue
118
- @notify&.error!($!.to_s)
119
+ rescue => error
120
+ @notify&.error!(error.to_s)
119
121
 
120
122
  raise SetupError, container
121
123
  end
@@ -126,7 +128,7 @@ module Async
126
128
  Console.logger.debug(self, "Finished startup.")
127
129
 
128
130
  if container.failed?
129
- @notify&.error!($!.to_s)
131
+ @notify&.error!("Container failed to start!")
130
132
 
131
133
  container.stop
132
134
 
@@ -165,7 +167,7 @@ module Async
165
167
  Console.logger.debug(self, "Finished startup.")
166
168
 
167
169
  if @container.failed?
168
- @notify.error!("Container failed!")
170
+ @notify.error!("Container failed to reload!")
169
171
 
170
172
  raise SetupError, @container
171
173
  else
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2017-2022, by Samuel Williams.
4
+ # Copyright, 2017-2024, by Samuel Williams.
5
5
 
6
6
  module Async
7
7
  module Container
8
- VERSION = "0.16.13"
8
+ VERSION = "0.17.0"
9
9
  end
10
10
  end
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.16.13
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -41,7 +41,7 @@ cert_chain:
41
41
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
42
42
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
43
43
  -----END CERTIFICATE-----
44
- date: 2024-02-20 00:00:00.000000000 Z
44
+ date: 2024-03-11 00:00:00.000000000 Z
45
45
  dependencies:
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: async
metadata.gz.sig CHANGED
Binary file