[Groonga-commit] droonga/droonga-engine at eb144e3 [master] Bounce messages immediately

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Apr 29 12:20:50 JST 2015


YUKI Hiroshi	2015-04-29 12:20:50 +0900 (Wed, 29 Apr 2015)

  New Revision: eb144e3bc7a95e528002c20266a73c77dca27bef
  https://github.com/droonga/droonga-engine/commit/eb144e3bc7a95e528002c20266a73c77dca27bef

  Message:
    Bounce messages immediately

  Modified files:
    lib/droonga/cluster.rb
    lib/droonga/engine_node.rb

  Modified: lib/droonga/cluster.rb (+1 -5)
===================================================================
--- lib/droonga/cluster.rb    2015-04-29 11:45:11 +0900 (2585555)
+++ lib/droonga/cluster.rb    2015-04-29 12:20:50 +0900 (5ca6505)
@@ -181,11 +181,7 @@ module Droonga
       end
       receiver = acceptable_nodes.sample
       if receiver
-        destination = {
-          "to"   => receiver.name,
-          "type" => message["type"],
-        }
-        receiver.forward(message, destination)
+        receiver.bounce(message)
       else
         logger.error("bounce: no available node with the role #{role}",
                      :message => message)

  Modified: lib/droonga/engine_node.rb (+8 -0)
===================================================================
--- lib/droonga/engine_node.rb    2015-04-29 11:45:11 +0900 (bf49db9)
+++ lib/droonga/engine_node.rb    2015-04-29 12:20:50 +0900 (2e5b4e3)
@@ -102,6 +102,14 @@ module Droonga
       end
     end
 
+    def bounce(message)
+      destination = {
+        "to"   => name,
+        "type" => message["type"],
+      }
+      output(message, destination)
+    end
+
     def role
       if @state
         @state["role"]
-------------- next part --------------
HTML����������������������������...
Descargar 



More information about the Groonga-commit mailing list
Back to archive index