Class: Smith::Commands::Kill
- Inherits:
-
Smith::CommandBase
- Object
- Smith::CommandBase
- Smith::Commands::Kill
- Includes:
- Common
- Defined in:
- lib/smith/commands/agency/kill.rb
Instance Attribute Summary
Attributes inherited from Smith::CommandBase
Instance Method Summary collapse
Methods included from Common
Methods inherited from Smith::CommandBase
#banner, #format_help, #initialize, #parse_options
Methods included from Logger
Constructor Details
This class inherits a constructor from Smith::CommandBase
Instance Method Details
#execute ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/smith/commands/agency/kill.rb', line 10 def execute work = ->(acc, uuid, iter) do if agents.exist?(uuid) agents[uuid].kill else acc << uuid end iter.return(acc) end done = ->(errors) { responder.succeed((errors)) } EM::Iterator.new(agents_to_kill).inject([], work, done) end |