async-container 0.16.8 → 0.16.9

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: ee8197b7402c0371e54a95c13e0f2d840d5482d23ba5f5824a0cd55255406ff0
4
- data.tar.gz: 69d2cf1a6c6fa55984e85a00745ad282784c52c31855d447a94e3f279c06e63c
3
+ metadata.gz: a76bd927dba80c9eb45b6e0c4ba41c463bfcbe1ffa90ff00b1cef7375e522670
4
+ data.tar.gz: 41aa83bb3be7be3ab3cdd8f2f7065a4960b800acdd39d5c89f2c420d70cc312b
5
5
  SHA512:
6
- metadata.gz: 8d95d54708ecf167ab38647cbe0ff9b92f87281c67c43e1f43ed9c251adfbadaed69e01ef9385005e010d59f771e347fe56d11d0b251d9e92592d3081606a0ba
7
- data.tar.gz: 74379b807e40a3a3758404552365393fa55a09fc9fb4cb337a07cebbe8521ea93cce30315d225d574ef15f56d4d1b90548ab6d170fcd152493366d4498770656
6
+ metadata.gz: 2c7878995dea584f4c5284214a5d96074ada191a2d54d07cc7f1dc6815e03edbc60ff729bc5f377c11a1ed00f531019aabefe89b13f04e7d305edcd6110a6770
7
+ data.tar.gz: ac4e0f6e39e315311283a71a8a24cfc64980c352c21bdc0a33fdcfd4217d4564b72229450583000263b814a668bbb1ae81cfa3c420e001ec042da58ccf650d75
@@ -122,9 +122,9 @@ module Async
122
122
  if @container
123
123
  @notify&.restarting!
124
124
 
125
- Async.logger.debug(self) {"Restarting container..."}
125
+ Console.logger.debug(self) {"Restarting container..."}
126
126
  else
127
- Async.logger.debug(self) {"Starting container..."}
127
+ Console.logger.debug(self) {"Starting container..."}
128
128
  end
129
129
 
130
130
  container = self.create_container
@@ -138,9 +138,9 @@ module Async
138
138
  end
139
139
 
140
140
  # Wait for all child processes to enter the ready state.
141
- Async.logger.debug(self, "Waiting for startup...")
141
+ Console.logger.debug(self, "Waiting for startup...")
142
142
  container.wait_until_ready
143
- Async.logger.debug(self, "Finished startup.")
143
+ Console.logger.debug(self, "Finished startup.")
144
144
 
145
145
  if container.failed?
146
146
  @notify&.error!($!.to_s)
@@ -154,7 +154,7 @@ module Async
154
154
  old_container = @container
155
155
  @container = container
156
156
 
157
- Async.logger.debug(self, "Stopping old container...")
157
+ Console.logger.debug(self, "Stopping old container...")
158
158
  old_container&.stop
159
159
  @notify&.ready!
160
160
  rescue
@@ -168,7 +168,7 @@ module Async
168
168
  def reload
169
169
  @notify&.reloading!
170
170
 
171
- Async.logger.info(self) {"Reloading container: #{@container}..."}
171
+ Console.logger.info(self) {"Reloading container: #{@container}..."}
172
172
 
173
173
  begin
174
174
  self.setup(@container)
@@ -177,9 +177,9 @@ module Async
177
177
  end
178
178
 
179
179
  # Wait for all child processes to enter the ready state.
180
- Async.logger.debug(self, "Waiting for startup...")
180
+ Console.logger.debug(self, "Waiting for startup...")
181
181
  @container.wait_until_ready
182
- Async.logger.debug(self, "Finished startup.")
182
+ Console.logger.debug(self, "Finished startup.")
183
183
 
184
184
  if @container.failed?
185
185
  @notify.error!("Container failed!")
@@ -215,7 +215,7 @@ module Async
215
215
  begin
216
216
  handler.call
217
217
  rescue SetupError => error
218
- Async.logger.error(self) {error}
218
+ Console.logger.error(self) {error}
219
219
  end
220
220
  else
221
221
  raise
@@ -119,7 +119,7 @@ module Async
119
119
  # @returns [Boolean] The children all became ready.
120
120
  def wait_until_ready
121
121
  while true
122
- Async.logger.debug(self) do |buffer|
122
+ Console.logger.debug(self) do |buffer|
123
123
  buffer.puts "Waiting for ready:"
124
124
  @state.each do |child, state|
125
125
  buffer.puts "\t#{child.class}: #{state.inspect}"
@@ -141,7 +141,7 @@ module Async
141
141
  @group.stop(timeout)
142
142
 
143
143
  if @group.running?
144
- Async.logger.warn(self) {"Group is still running after stopping it!"}
144
+ Console.logger.warn(self) {"Group is still running after stopping it!"}
145
145
  end
146
146
  ensure
147
147
  @running = true
@@ -155,7 +155,7 @@ module Async
155
155
  name ||= UNNAMED
156
156
 
157
157
  if mark?(key)
158
- Async.logger.debug(self) {"Reusing existing child for #{key}: #{name}"}
158
+ Console.logger.debug(self) {"Reusing existing child for #{key}: #{name}"}
159
159
  return false
160
160
  end
161
161
 
@@ -176,10 +176,10 @@ module Async
176
176
  end
177
177
 
178
178
  if status.success?
179
- Async.logger.info(self) {"#{child} exited with #{status}"}
179
+ Console.logger.info(self) {"#{child} exited with #{status}"}
180
180
  else
181
181
  @statistics.failure!
182
- Async.logger.error(self) {status}
182
+ Console.logger.error(self) {status}
183
183
  end
184
184
 
185
185
  if restart
@@ -189,7 +189,7 @@ module Async
189
189
  end
190
190
  end
191
191
  # ensure
192
- # Async.logger.error(self) {$!} if $!
192
+ # Console.logger.error(self) {$!} if $!
193
193
  end.resume
194
194
 
195
195
  return true
@@ -78,7 +78,7 @@ module Async
78
78
  # Interrupt all running processes.
79
79
  # This resumes the controlling fiber with an instance of {Interrupt}.
80
80
  def interrupt
81
- Async.logger.debug(self, "Sending interrupt to #{@running.size} running processes...")
81
+ Console.logger.debug(self, "Sending interrupt to #{@running.size} running processes...")
82
82
  @running.each_value do |fiber|
83
83
  fiber.resume(Interrupt)
84
84
  end
@@ -87,7 +87,7 @@ module Async
87
87
  # Terminate all running processes.
88
88
  # This resumes the controlling fiber with an instance of {Terminate}.
89
89
  def terminate
90
- Async.logger.debug(self, "Sending terminate to #{@running.size} running processes...")
90
+ Console.logger.debug(self, "Sending terminate to #{@running.size} running processes...")
91
91
  @running.each_value do |fiber|
92
92
  fiber.resume(Terminate)
93
93
  end
@@ -38,7 +38,7 @@ module Async
38
38
  self.new(::IO.for_fd(descriptor.to_i))
39
39
  end
40
40
  rescue Errno::EBADF => error
41
- Async.logger.error(self) {error}
41
+ Console.logger.error(self) {error}
42
42
 
43
43
  return nil
44
44
  end
@@ -91,7 +91,7 @@ module Async
91
91
  rescue Interrupt
92
92
  # Graceful exit.
93
93
  rescue Exception => error
94
- Async.logger.error(self) {error}
94
+ Console.logger.error(self) {error}
95
95
 
96
96
  exit!(1)
97
97
  end
@@ -177,7 +177,7 @@ module Async
177
177
  end
178
178
 
179
179
  if @status.nil?
180
- Async.logger.warn(self) {"Process #{@pid} is blocking, has it exited?"}
180
+ Console.logger.warn(self) {"Process #{@pid} is blocking, has it exited?"}
181
181
  _, @status = ::Process.wait2(@pid)
182
182
  end
183
183
  end
@@ -24,8 +24,6 @@ require_relative 'channel'
24
24
  require_relative 'error'
25
25
  require_relative 'notify/pipe'
26
26
 
27
- require 'async/logger'
28
-
29
27
  module Async
30
28
  module Container
31
29
  # Represents a running child thread from the point of view of the parent container.
@@ -207,7 +205,7 @@ module Async
207
205
  # Invoked by the @waiter thread to indicate the outcome of the child thread.
208
206
  def finished(error = nil)
209
207
  if error
210
- Async.logger.error(self) {error}
208
+ Console.logger.error(self) {error}
211
209
  end
212
210
 
213
211
  @status = Status.new(error)
@@ -22,6 +22,6 @@
22
22
 
23
23
  module Async
24
24
  module Container
25
- VERSION = "0.16.8"
25
+ VERSION = "0.16.9"
26
26
  end
27
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-container
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.8
4
+ version: 0.16.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-19 00:00:00.000000000 Z
11
+ date: 2021-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
142
  requirements: []
143
- rubygems_version: 3.1.2
143
+ rubygems_version: 3.2.3
144
144
  signing_key:
145
145
  specification_version: 4
146
146
  summary: Abstract container-based parallelism using threads and processes where appropriate.