Class: SSHKit::Runner::Group
- Inherits:
-
Sequential
- Object
- Abstract
- Sequential
- SSHKit::Runner::Group
- Defined in:
- lib/sshkit/runners/group.rb
Instance Attribute Summary collapse
-
#group_size ⇒ Object
Returns the value of attribute group_size.
Attributes inherited from Sequential
Attributes inherited from Abstract
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(hosts, options = nil, &block) ⇒ Group
constructor
A new instance of Group.
Constructor Details
#initialize(hosts, options = nil, &block) ⇒ Group
8 9 10 11 |
# File 'lib/sshkit/runners/group.rb', line 8 def initialize(hosts, = nil, &block) super(hosts, , &block) @group_size = [:limit] || 2 end |
Instance Attribute Details
#group_size ⇒ Object
Returns the value of attribute group_size.
6 7 8 |
# File 'lib/sshkit/runners/group.rb', line 6 def group_size @group_size end |
Instance Method Details
#execute ⇒ Object
13 14 15 16 17 18 |
# File 'lib/sshkit/runners/group.rb', line 13 def execute hosts.each_slice(group_size).collect do |group_hosts| Parallel.new(group_hosts, &block).execute sleep wait_interval end.flatten end |