[Groonga-commit] droonga/droonga-engine at 2597d53 [master] Remove needless custom implementation to parse node name

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Apr 30 11:58:25 JST 2015


YUKI Hiroshi	2015-04-30 11:58:25 +0900 (Thu, 30 Apr 2015)

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

  Message:
    Remove needless custom implementation to parse node name

  Modified files:
    lib/droonga/engine_node.rb

  Modified: lib/droonga/engine_node.rb (+2 -13)
===================================================================
--- lib/droonga/engine_node.rb    2015-04-30 11:51:01 +0900 (4d7ac40)
+++ lib/droonga/engine_node.rb    2015-04-30 11:58:25 +0900 (1a48de1)
@@ -181,17 +181,6 @@ module Droonga
     end
 
     private
-    def parse_node_name(name)
-      unless name =~ /\A(.*):(\d+)\/([^.]+)\z/
-        raise "name format: hostname:port/tag"
-      end
-      {
-        :host => $1,
-        :port => $2,
-        :tag  => $3,
-      }
-    end
-
     def have_unprocessed_messages?
       @state and @state["have_unprocessed_messages"]
     end
@@ -249,14 +238,14 @@ module Droonga
       command = destination["type"]
       receiver = destination["to"]
       arguments = destination["arguments"]
-      parsed_receiver = parse_node_name(receiver)
+      parsed_receiver = NodeName.parse(receiver)
 
       override_message = {
         "type" => command,
       }
       override_message["arguments"] = arguments if arguments
       message = message.merge(override_message)
-      output_tag = "#{parsed_receiver[:tag]}.message"
+      output_tag = "#{parsed_receiver.tag}.message"
       log_info = "<#{receiver}>:<#{output_tag}>"
       logger.trace("forward: start: #{log_info}")
       sender.send(output_tag, message)
-------------- next part --------------
HTML����������������������������...
Télécharger 



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