Class: GroupRunner

Inherits:
SequentialRunner show all
Defined in:
lib/sshkit/connection_manager.rb

Instance Attribute Summary collapse

Attributes inherited from Runner

#block, #hosts

Instance Method Summary collapse

Methods inherited from Runner

#initialize

Constructor Details

This class inherits a constructor from Runner

Instance Attribute Details

#group_size=(value) ⇒ Object

Sets the attribute group_size

Parameters:

  • value

    the value to set the attribute group_size to.



41
42
43
# File 'lib/sshkit/connection_manager.rb', line 41

def group_size=(value)
  @group_size = value
end

Instance Method Details

#executeObject



42
43
44
45
46
47
# File 'lib/sshkit/connection_manager.rb', line 42

def execute
  hosts.each_slice(group_size).collect do |group_hosts|
    ParallelRunner.new(group_hosts, &block).execute
    sleep wait_interval
  end.flatten
end