async-container 0.16.13 → 0.17.1

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: ca8c53ca974eedc0759ad1d030e4ccedc9aa223911a37954c1a60736ca97ec66
4
+ data.tar.gz: c1ea63c60f1b3d8890a9bff9bdf2ba07347bec4fb4c589da0cc6517382fa8ae5
5
5
  SHA512:
6
- metadata.gz: d1e86aac065481fbae985a9b2876c710407327c37fd5b80dc0e5fe2d42bde88b4b6db97034cc5b150dbb6e8d8446bc49b363dd78af9ad82d5bee411d5a76046e
7
- data.tar.gz: e5fe7ba13b26c65d94a258d9fe2606ce1f51513927958e4542d9ccff3ec8fa285ab0a46692ed520e4049a0a06262ec7383238a5d90f609060661d96e4d1f3ce5
6
+ metadata.gz: 0f5f2433accfc4f8e4f702a420df060eee14594ec03d260ce4f048349650edcd541ee7256010003a71b9164bd2ac152941c069dde5847e7e0db387b5da02a5fe
7
+ data.tar.gz: f352c280c2c6a5de77657e32cba0d256daa09bf0e14254a96b2e95983ed598ebdaa1f5e3e9e4d8c0029616caa29d8e83dd3e47b3382cb16a8a91e07d8081db9a
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
@@ -161,7 +161,7 @@ module Async
161
161
  end
162
162
 
163
163
  if status.success?
164
- Console.logger.info(self) {"#{child} exited with #{status}"}
164
+ Console.logger.debug(self) {"#{child} exited with #{status}"}
165
165
  else
166
166
  @statistics.failure!
167
167
  Console.logger.error(self) {status}
@@ -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.1"
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.1
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-22 00:00:00.000000000 Z
45
45
  dependencies:
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: async
metadata.gz.sig CHANGED
Binary file