in-parallel 0.1.3 → 0.1.4

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
  SHA1:
3
- metadata.gz: 58e993aeb43d7857ec9b54e106fa8edc5eaea927
4
- data.tar.gz: 212e1572691d6abb29010bac6b5c6e50d96d9266
3
+ metadata.gz: 954d90d6730f964c9b6af33e32f377681d762124
4
+ data.tar.gz: 5714427d316d51853feb018ee79f6dc9fa1fa687
5
5
  SHA512:
6
- metadata.gz: 67292f6cb91c332d2989a2815427258271dc526ab4085e393fe064d70aa15af8a7dceaa71dbc204db0675e3e22180d665686fb89738b469d0ef4db539d3695ff
7
- data.tar.gz: 82523c788f279d02977d3090cc84ab193d4d5255c7fb02202ba7e43ddaab888d2bd5257dd8645e671eb372d3c3d4a723d2f640bad9add629c9901520d2dbc953
6
+ metadata.gz: f8ff13104c07ec1b88d9b08b14f28bc939f61a1d5e26b47d927aab6aadb17ee7dedcf12794cbe62f87db2672bae85a8dc7fbf54ec08ba7a5e36b3374e5498908
7
+ data.tar.gz: 6c371de92cac2770beca520bc4cb261f85d8d51e0b06c59f0a755cc18c1b2908af1fa59081296ac4b5f14d4108d004cf32e539416cec8cf242c14f4490bea573
@@ -1,3 +1,3 @@
1
1
  class InParallel
2
- VERSION = Version = '0.1.3'
2
+ VERSION = Version = '0.1.4'
3
3
  end
data/lib/in_parallel.rb CHANGED
@@ -97,7 +97,7 @@ class InParallel
97
97
  def self.wait_for_processes
98
98
  trap(:INT) do
99
99
  puts "Warning, recieved interrupt. Processing child results and exiting."
100
- @@proces_infos.each { |process_info|
100
+ @@process_infos.each { |process_info|
101
101
  # Send INT to each child process so it returns and can print stdout and stderr to console before exiting.
102
102
  Process.kill("INT", process_info[:pid])
103
103
  }
@@ -183,13 +183,21 @@ class InParallel
183
183
  # Write the result to the write_result IO stream.
184
184
  # Have to serialize the value so it can be transmitted via IO
185
185
  if(!ret_val.nil? && ret_val.singleton_methods && ret_val.class != TrueClass && ret_val.class != FalseClass && ret_val.class != Fixnum)
186
+ #in case there are other types that can't be duped
186
187
  begin
187
188
  ret_val = ret_val.dup
188
189
  rescue StandardError => err
189
- #in case there are other types that can't dup
190
+ puts "Warning: return value from child process #{ret_val} " +
191
+ "could not be transferred to parent process: #{err.message}"
190
192
  end
191
193
  end
192
- Marshal.dump(ret_val, write_result) unless ret_val.nil?
194
+ # In case there are other types that can't be dumped
195
+ begin
196
+ Marshal.dump(ret_val, write_result) unless ret_val.nil?
197
+ rescue StandardError => err
198
+ puts "Warning: return value from child process #{ret_val} " +
199
+ "could not be transferred to parent process: #{err.message}"
200
+ end
193
201
  rescue StandardError => err
194
202
  puts "Error in process #{pid}: #{err.message}"
195
203
  # Return the error if an error is rescued so we can re-throw in the main process.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: in-parallel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - samwoods1
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-27 00:00:00.000000000 Z
11
+ date: 2016-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler