[Groonga-commit] droonga/droonga-engine at 2cabfa2 [master] Split operation to output fluent message actually from "forward"

Back to archive index

YUKI Hiroshi null+****@clear*****
Tue Jan 6 19:48:35 JST 2015


YUKI Hiroshi	2015-01-06 19:48:35 +0900 (Tue, 06 Jan 2015)

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

  Message:
    Split operation to output fluent message actually from "forward"

  Modified files:
    lib/droonga/engine_node.rb

  Modified: lib/droonga/engine_node.rb (+18 -14)
===================================================================
--- lib/droonga/engine_node.rb    2015-01-06 19:47:34 +0900 (1e75035)
+++ lib/droonga/engine_node.rb    2015-01-06 19:48:35 +0900 (f0aa781)
@@ -52,20 +52,7 @@ module Droonga
     end
 
     def forward(message, destination)
-      command = destination["type"]
-      receiver = destination["to"]
-      arguments = destination["arguments"]
-
-      override_message = {
-        "type" => command,
-      }
-      override_message["arguments"] = arguments if arguments
-      message = message.merge(override_message)
-      output_tag = "#{tag}.message"
-      log_info = "<#{receiver}>:<#{output_tag}>"
-      logger.trace("forward: start: #{log_info}")
-      @sender.send(output_tag, message)
-      logger.trace("forward: end")
+      output(message, destination)
     end
 
     def live?
@@ -129,6 +116,23 @@ module Droonga
     end
 
     private
+    def output(message, destination)
+      command = destination["type"]
+      receiver = destination["to"]
+      arguments = destination["arguments"]
+
+      override_message = {
+        "type" => command,
+      }
+      override_message["arguments"] = arguments if arguments
+      message = message.merge(override_message)
+      output_tag = "#{tag}.message"
+      log_info = "<#{receiver}>:<#{output_tag}>"
+      logger.trace("forward: start: #{log_info}")
+      @sender.send(output_tag, message)
+      logger.trace("forward: end")
+    end
+
     def log_tag
       "[#{Process.ppid}] engine-node"
     end
-------------- next part --------------
HTML����������������������������...
下载 



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