Class: Droonga::Distributor
- Inherits:
-
Object
- Object
- Droonga::Distributor
- Includes:
- Pluggable
- Defined in:
- lib/droonga/distributor.rb
Instance Method Summary collapse
- #distribute(components) ⇒ Object
-
#initialize(dispatcher, options = {}) ⇒ Distributor
constructor
A new instance of Distributor.
Methods included from Pluggable
#process, #processable?, #shutdown
Constructor Details
#initialize(dispatcher, options = {}) ⇒ Distributor
Returns a new instance of Distributor.
26 27 28 29 30 31 32 |
# File 'lib/droonga/distributor.rb', line 26 def initialize(dispatcher, ={}) @dispatcher = dispatcher @plugins = [] @options = # TODO: don't put the default distributions load_plugins([:distributors] || ["search", "crud", "groonga", "watch"]) end |
Instance Method Details
#distribute(components) ⇒ Object
34 35 36 37 38 |
# File 'lib/droonga/distributor.rb', line 34 def distribute(components) planner = DistributionPlanner.new(@dispatcher, components) planned_components = planner.plan @dispatcher.dispatch_components(planned_components) end |