Class: Droonga::DistributorPlugin
- Extended by:
- PluginRegisterable
- Defined in:
- lib/droonga/distributor_plugin.rb
Direct Known Subclasses
CRUDDistributor, GroongaDistributor, SearchDistributor, WatchDistributor
Instance Method Summary collapse
- #broadcast_all(message) ⇒ Object
- #distribute(message) ⇒ Object
-
#initialize(distributor) ⇒ DistributorPlugin
constructor
A new instance of DistributorPlugin.
- #scatter_all(message, key) ⇒ Object
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
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/droonga/distributor_plugin.rb', line 46 def broadcast_all() = [{ "command"=> ["type"], "dataset"=> ["dataset"], "body"=> ["body"], "type"=> "broadcast", "replica"=> "all", "post"=> true }] distribute() end |
#distribute(message) ⇒ Object
29 30 31 |
# File 'lib/droonga/distributor_plugin.rb', line 29 def distribute() @distributor.distribute() end |
#scatter_all(message, key) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/droonga/distributor_plugin.rb', line 33 def scatter_all(, key) = [{ "command"=> ["type"], "dataset"=> ["dataset"], "body"=> ["body"], "key"=> key, "type"=> "scatter", "replica"=> "all", "post"=> true }] distribute() end |