Sha256: e3f48fa91ec090b248046d047af167d9cef0f3593a169db71f0aef3421f21d3a
Contents?: true
Size: 524 Bytes
Versions: 31
Compression:
Stored size: 524 Bytes
Contents
require 'thread' module SSHKit module Runner class Parallel < Abstract def execute threads = hosts.map do |host| Thread.new(host) do |h| begin backend(h, &block).run rescue ::StandardError => e e2 = ExecuteError.new e raise e2, "Exception while executing #{host.user ? "as #{host.user}@" : "on host "}#{host}: #{e.message}" end end end threads.each(&:join) end end end end
Version data entries
31 entries across 31 versions & 2 rubygems