Class: Smith::Commands::Status

Inherits:
Smith::CommandBase show all
Defined in:
lib/smith/commands/smithctl/status.rb

Instance Attribute Summary

Attributes inherited from Smith::CommandBase

#options, #target

Instance Method Summary collapse

Methods inherited from Smith::CommandBase

#banner, #format_help, #initialize, #parse_options

Methods included from Logger

included

Constructor Details

This class inherits a constructor from Smith::CommandBase

Instance Method Details

#executeObject



8
9
10
11
12
# File 'lib/smith/commands/smithctl/status.rb', line 8

def execute
  status do |s|
    responder.succeed((s) ? "Agency running" : "Agency not running")
  end
end

#status(&blk) ⇒ Object



14
15
16
17
18
# File 'lib/smith/commands/smithctl/status.rb', line 14

def status(&blk)
  Messaging::Queue.number_of_consumers(QueueDefinitions::Agency_control) do |consumers_count|
    blk.call(consumers_count > 0)
  end
end