autorespawn 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -3
- data/Gemfile +3 -1
- data/lib/autorespawn/manager.rb +1 -1
- data/lib/autorespawn/self.rb +1 -0
- data/lib/autorespawn/slave.rb +14 -11
- data/lib/autorespawn/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbeef4d4a63c70db5e4ba394a2c5f3c70b930d2f
|
4
|
+
data.tar.gz: e9922d68d0834d6d8f14d5cb14be774bae7b19bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f98a52dc8154a7b0c9c620863f9092b5d11ec357797334e4adcdf0a1f76a943512d4ef4f7261dd7c3da6ec9fd344677f93072932fd2815d95d5490389619e2e1
|
7
|
+
data.tar.gz: 73d84d86164b24b0b8e491f08b9c3f220a6668e62dc0770d22be9b7a52a94d992fa4b920d782ede30a1b4e7bcb7245b8ce60cb8497b2e19ce2720b75d7c5ac15
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/lib/autorespawn/manager.rb
CHANGED
@@ -247,7 +247,7 @@ def poll(autospawn: true, update_files: true)
|
|
247
247
|
new_slaves = Array.new
|
248
248
|
|
249
249
|
trigger_slaves_as_necessary
|
250
|
-
active_slaves.each_value
|
250
|
+
active_slaves.each_value(&:poll)
|
251
251
|
|
252
252
|
while active_slaves.size < parallel_level + 1
|
253
253
|
if slave = queued_slaves.find { |s| !s.running? }
|
data/lib/autorespawn/self.rb
CHANGED
data/lib/autorespawn/slave.rb
CHANGED
@@ -136,22 +136,25 @@ def spawn(send_initial_dump: true)
|
|
136
136
|
raise
|
137
137
|
end
|
138
138
|
|
139
|
+
# Must be called regularly to ensure a good communication with the slave
|
140
|
+
def poll
|
141
|
+
return unless running?
|
142
|
+
|
143
|
+
write_initial_dump
|
144
|
+
read_queued_result
|
145
|
+
end
|
146
|
+
|
139
147
|
# Write as much of the initial dump to the slave
|
140
148
|
#
|
141
149
|
# To avoid blocking in {#spawn}, the initial dump
|
142
150
|
def write_initial_dump
|
143
|
-
if
|
144
|
-
begin
|
145
|
-
written_bytes = initial_w.write_nonblock(initial_dump)
|
146
|
-
rescue IO::WaitWritable
|
147
|
-
written_bytes = 0
|
148
|
-
end
|
151
|
+
return if initial_dump.empty?
|
149
152
|
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
153
|
+
written_bytes = initial_w.write_nonblock(initial_dump)
|
154
|
+
@initial_dump = @initial_dump[written_bytes, initial_dump.size - written_bytes]
|
155
|
+
initial_dump.empty?
|
156
|
+
rescue IO::WaitWritable
|
157
|
+
true
|
155
158
|
end
|
156
159
|
|
157
160
|
# Whether this slave would need to be spawned, either because it has
|
data/lib/autorespawn/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autorespawn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvain Joyeux
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hooks
|
@@ -188,9 +188,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
188
188
|
version: '0'
|
189
189
|
requirements: []
|
190
190
|
rubyforge_project:
|
191
|
-
rubygems_version: 2.
|
191
|
+
rubygems_version: 2.5.1
|
192
192
|
signing_key:
|
193
193
|
specification_version: 4
|
194
194
|
summary: functionality to respawn a Ruby program when its source changes
|
195
195
|
test_files: []
|
196
|
-
has_rdoc:
|