Class: SSHKit::Custom::Config::Runner::Parallel

Inherits:
Abstract
  • Object
show all
Defined in:
lib/sshkit/custom/config/runner/parallel.rb

Instance Attribute Summary

Attributes inherited from Abstract

#backends, #options

Instance Method Summary collapse

Methods inherited from Abstract

#active_backend, active_backend, active_backend=, #active_backend=, #apply_to_bck, create_runner, #initialize, scope, scope_storage, #send_cmd

Constructor Details

This class inherits a constructor from SSHKit::Custom::Config::Runner::Abstract

Instance Method Details

#apply_block_to_bcks(&block) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/sshkit/custom/config/runner/parallel.rb', line 8

def apply_block_to_bcks(&block)
  threads = []

  backends.each do |next_backend|

    threads << Thread.new(next_backend) do |backend|
      apply_to_bck backend, &block
    end

  end

  threads.map(&:join)
end