bin/riemann-babbler in riemann-babbler-0.3.7 vs bin/riemann-babbler in riemann-babbler-0.3.8

- old
+ new

@@ -3,10 +3,11 @@ require 'trollop' require 'yaml' require 'configatron' require 'logger' +require 'parallel' require File.expand_path('../../lib/riemann/version', __FILE__) require File.expand_path('../../lib/deep_merge', __FILE__) require File.expand_path('../../lib/riemann/babbler/plugin', __FILE__) @@ -62,16 +63,9 @@ end # start plugins plugins.each { |plugin| require plugin } -plugin_threads = Riemann::Babbler.registered_plugins.map do |plugin| - Thread.new { - plugin.new( configatron, logger ).run - } +riemann_plugins = Riemann::Babbler.registered_plugins +Parallel.each( riemann_plugins, :in_threads => riemann_plugins.count ) do |plugin| + plugin.new( configatron, logger ).run end - -Signal.trap "USR1" do - plugin_threads.each( &:kill ) -end - -plugin_threads.each( &:join )