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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff4cfc6c34ead02c1c7d41292c6061978018a914
4
- data.tar.gz: 1a549ef5140d9918228595d87e24664a17b43c77
3
+ metadata.gz: dbeef4d4a63c70db5e4ba394a2c5f3c70b930d2f
4
+ data.tar.gz: e9922d68d0834d6d8f14d5cb14be774bae7b19bb
5
5
  SHA512:
6
- metadata.gz: 2e5a7513ff2ba21c63373263e5f1075978cac6266226ec808bf92e3f37227bad5d596d0ea9de3eb34c96ce7ab5fdcc2b7832bd5f998186c27af987817d375dba
7
- data.tar.gz: f65c67dc887c0cab8ad812a9398a8b3ba815c1b45187c4efea49e7f035a4a6320d8a7f29600260e7e92e6531a97d88b4107866164a1e56c2790ca6fbc3680636
6
+ metadata.gz: f98a52dc8154a7b0c9c620863f9092b5d11ec357797334e4adcdf0a1f76a943512d4ef4f7261dd7c3da6ec9fd344677f93072932fd2815d95d5490389619e2e1
7
+ data.tar.gz: 73d84d86164b24b0b8e491f08b9c3f220a6668e62dc0770d22be9b7a52a94d992fa4b920d782ede30a1b4e7bcb7245b8ce60cb8497b2e19ce2720b75d7c5ac15
@@ -1,8 +1,9 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.6
4
- - 2.2.2
5
- before_install: gem install bundler -v 1.10.5
3
+ - 2.1.8
4
+ - 2.2.5
5
+ - 2.3.1
6
+ before_install: gem install bundler
6
7
  script:
7
8
  - bundler exec rake
8
9
  - bundler exec rake test
data/Gemfile CHANGED
@@ -1,6 +1,8 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'pry'
4
- gem 'pry-byebug'
4
+ platform :mri do
5
+ gem 'pry-byebug'
6
+ end
5
7
  # Specify your gem's dependencies in autorespawn.gemspec
6
8
  gemspec
@@ -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.each(&:write_initial_dump)
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? }
@@ -25,5 +25,6 @@ def running?
25
25
  def finished?
26
26
  false
27
27
  end
28
+ def poll; end
28
29
  end
29
30
  end
@@ -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 !initial_dump.empty?
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
- @initial_dump = @initial_dump[written_bytes, initial_dump.size - written_bytes]
151
- initial_dump.empty?
152
- else
153
- true
154
- end
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
@@ -1,3 +1,3 @@
1
1
  class Autorespawn
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
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.0
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: 2016-04-27 00:00:00.000000000 Z
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.2.3
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: