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(envelope) ⇒ Object
-
#initialize(distributor) ⇒ DistributorPlugin
constructor
A new instance of DistributorPlugin.
-
#post(message) ⇒ Object
TODO: consider better name.
- #scatter_all(envelope, 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(envelope) ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/droonga/distributor_plugin.rb', line 47 def broadcast_all(envelope) = [{ "command"=> envelope["type"], "dataset"=> envelope["dataset"], "body"=> envelope["body"], "type"=> "broadcast", "replica"=> "all", "post"=> true }] post() end |
#post(message) ⇒ Object
TODO: consider better name
30 31 32 |
# File 'lib/droonga/distributor_plugin.rb', line 30 def post() @distributor.post() end |
#scatter_all(envelope, key) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/droonga/distributor_plugin.rb', line 34 def scatter_all(envelope, key) = [{ "command"=> envelope["type"], "dataset"=> envelope["dataset"], "body"=> envelope["body"], "key"=> key, "type"=> "scatter", "replica"=> "all", "post"=> true }] post() end |