Class: Droonga::Plugins::System::StatusHandler

Inherits:
Handler
  • Object
show all
Defined in:
lib/droonga/plugins/system.rb

Instance Attribute Summary

Attributes inherited from Handler

#loop, #messenger

Instance Method Summary collapse

Methods inherited from Handler

action, #initialize, message

Methods included from Droonga::Pluggable

#find_sub_classes, #options

Constructor Details

This class inherits a constructor from Droonga::Handler

Instance Method Details

#handle(message) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/droonga/plugins/system.rb', line 27

def handle(message)
  engine_state = @messenger.engine_state
  live_nodes = engine_state.live_nodes
  nodes = {}
  engine_state.all_nodes.collect do |identifier|
    nodes[identifier] = {
      "live" => live_nodes.include?(identifier),
    }
  end

  {
    "nodes" => nodes,
  }
end