Class: SSHKit::Runner::Group

Inherits:
Sequential show all
Defined in:
lib/sshkit/runners/group.rb

Instance Attribute Summary collapse

Attributes inherited from Abstract

#block, #hosts, #options

Instance Method Summary collapse

Methods inherited from Abstract

#initialize

Constructor Details

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

Instance Attribute Details

#group_size=(value) ⇒ Object

Sets the attribute group_size

Parameters:

  • value

    the value to set the attribute group_size to.



6
7
8
# File 'lib/sshkit/runners/group.rb', line 6

def group_size=(value)
  @group_size = value
end

Instance Method Details

#executeObject



7
8
9
10
11
12
# File 'lib/sshkit/runners/group.rb', line 7

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