From 587f3be16e58b32a0384384a0870db0c24a2ad4f Mon Sep 17 00:00:00 2001 From: Julien Feltesse Date: Tue, 23 Feb 2016 19:00:38 +0900 Subject: [PATCH] depend on concurrent-ruby ~> 1.0.0 --- hermann.gemspec | 2 +- lib/hermann/producer.rb | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hermann.gemspec b/hermann.gemspec index 903ae6a..0aa64e2 100644 --- a/hermann.gemspec +++ b/hermann.gemspec @@ -29,7 +29,7 @@ Gem::Specification.new do |s| if RUBY_PLATFORM == "java" s.files << 'lib/hermann_jars.rb' - s.add_dependency 'concurrent-ruby', '~> 0.7.0' + s.add_dependency 'concurrent-ruby', '~> 1.0.0' # IMPORTANT: make sure that jar-dependencies is only a development # dependency of your gem. if it is a runtime dependencies the require_jars diff --git a/lib/hermann/producer.rb b/lib/hermann/producer.rb index 50ab838..b57d3b5 100644 --- a/lib/hermann/producer.rb +++ b/lib/hermann/producer.rb @@ -102,7 +102,8 @@ module Hermann @children.each do |child| # Skip over any children that should already be reaped for other # reasons - next if child.completed? + next if (Hermann.jruby? ? child.fulfilled? : child.completed?) + # Propagate errors to the remaining children child.internal_set_error(ex) end @@ -118,7 +119,7 @@ module Hermann # Filter all children who are no longer pending/fulfilled total_children = @children.size - @children = @children.reject { |c| c.completed? } + @children = @children.reject { |c| Hermann.jruby? ? c.fulfilled? : c.completed? } return (total_children - children.size) end