Class: Droonga::DistributorPlugin

Inherits:
Plugin
  • Object
show all
Extended by:
PluginRegisterable
Defined in:
lib/droonga/distributor_plugin.rb

Instance Method Summary collapse

Methods included from PluginRegisterable

command, extended, inherited, method_name, processable?, repository

Methods inherited from Plugin

#process, #processable?, #shutdown, #start

Constructor Details

#initialize(distributor) ⇒ DistributorPlugin

Returns a new instance of DistributorPlugin.



24
25
26
27
# File 'lib/droonga/distributor_plugin.rb', line 24

def initialize(distributor)
  super()
  @distributor = distributor
end

Instance Method Details

#broadcast_all(message) ⇒ Object



38
39
40
41
# File 'lib/droonga/distributor_plugin.rb', line 38

def broadcast_all(message)
  messages = [reducer(message), gatherer(message), broadcaster(message)]
  distribute(messages)
end

#distribute(message) ⇒ Object



29
30
31
# File 'lib/droonga/distributor_plugin.rb', line 29

def distribute(message)
  @distributor.distribute(message)
end

#scatter_all(message, key) ⇒ Object



33
34
35
36
# File 'lib/droonga/distributor_plugin.rb', line 33

def scatter_all(message, key)
  messages = [reducer(message), gatherer(message), scatterer(message, key)]
  distribute(messages)
end