Sha256: 6d0e6e7ef32d6f34ee0e622c46c136693c29baba88fb8924911fff785b0198df

Contents?: true

Size: 503 Bytes

Versions: 5

Compression:

Stored size: 503 Bytes

Contents

require 'thread'

module SSHKit

  module Runner

    class Parallel < Abstract
      def execute
        threads = []
        hosts.each do |host|
          threads << Thread.new(host) do |h|
            begin
              backend(h, &block).run
            rescue Exception => e
              e2 = ExecuteError.new e
              raise e2, "Exception while executing on host #{host}: #{e.message}" 
            end
          end
        end
        threads.map(&:join)
      end
    end

  end

end

Version data entries

5 entries across 3 versions & 2 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/sshkit-1.5.1/lib/sshkit/runners/parallel.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/sshkit-1.5.1/lib/sshkit/runners/parallel.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/sshkit-1.5.1/lib/sshkit/runners/parallel.rb
sshkit-1.5.1 lib/sshkit/runners/parallel.rb
sshkit-1.5.0 lib/sshkit/runners/parallel.rb