Class: Ndo::MultiCommand
- Inherits:
-
Object
- Object
- Ndo::MultiCommand
- Includes:
- Procrastinate
- Defined in:
- lib/ndo/multi_command.rb
Overview
A class to execute a command on a list of hosts in parallel; allows access to results and is thus a) multi threaded and b) Ruby 1.9.2 only.
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#hosts ⇒ Object
readonly
Returns the value of attribute hosts.
Instance Method Summary collapse
-
#initialize(command, hosts) ⇒ MultiCommand
constructor
A new instance of MultiCommand.
-
#run ⇒ Object
Runs the command on all hosts.
- #run_for_host(host) ⇒ Object
Constructor Details
#initialize(command, hosts) ⇒ MultiCommand
Returns a new instance of MultiCommand.
17 18 19 20 |
# File 'lib/ndo/multi_command.rb', line 17 def initialize(command, hosts) @command = command @hosts = hosts end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
14 15 16 |
# File 'lib/ndo/multi_command.rb', line 14 def command @command end |
#hosts ⇒ Object (readonly)
Returns the value of attribute hosts.
15 16 17 |
# File 'lib/ndo/multi_command.rb', line 15 def hosts @hosts end |