[Groonga-commit] droonga/fluent-plugin-droonga at d37ffe7 [master] Remove unused codes

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Dec 20 15:50:42 JST 2013


Kouhei Sutou	2013-12-20 15:50:42 +0900 (Fri, 20 Dec 2013)

  New Revision: d37ffe771ec1d84a16acc7a212cdd32aa6504aec
  https://github.com/droonga/fluent-plugin-droonga/commit/d37ffe771ec1d84a16acc7a212cdd32aa6504aec

  Message:
    Remove unused codes

  Modified files:
    lib/droonga/collector.rb
    lib/droonga/dispatcher.rb

  Modified: lib/droonga/collector.rb (+2 -6)
===================================================================
--- lib/droonga/collector.rb    2013-12-20 15:33:51 +0900 (99160ea)
+++ lib/droonga/collector.rb    2013-12-20 15:50:42 +0900 (caabede)
@@ -53,7 +53,7 @@ module Droonga
           "task"        => task,
           "descendants" => descendants
         }
-        @dispatcher.deliver(@id, task["route"], message, command, synchronous)
+        @dispatcher.process_in_farm(task["route"], message, command, synchronous)
         @n_dones += 1
         @dispatcher.collectors.delete(@id) if @n_dones ==****@tasks*****
       end
@@ -91,11 +91,7 @@ module Droonga
           message["descendants"] = descendants
           message["id"] = @id
         end
-        if @id == task["route"]
-          process(command, message)
-        else
-          @dispatcher.deliver(@id, task["route"], message, command, synchronous)
-        end
+        process(command, message)
         return if task["n_of_inputs"] < n_of_expects
         #the task is done
         if synchronous

  Modified: lib/droonga/dispatcher.rb (+5 -7)
===================================================================
--- lib/droonga/dispatcher.rb    2013-12-20 15:33:51 +0900 (5f65d92)
+++ lib/droonga/dispatcher.rb    2013-12-20 15:50:42 +0900 (a492cd8)
@@ -148,13 +148,11 @@ module Droonga
       end
     end
 
-    def deliver(id, route, message, type, synchronous)
-      if id == route
-        post(message, "type" => type, "synchronous"=> synchronous)
-      else
-        envelope =****@envel*****("body" => message, "type" => type)
-        @farm.process(route, envelope, synchronous)
-      end
+    # TODO: Use more meaningful name
+    def process_in_farm(route, message, type, synchronous)
+      # TODO: validate route is farm path
+      envelope =****@envel*****("body" => message, "type" => type)
+      @farm.process(route, envelope, synchronous)
     end
 
     def generate_id
-------------- next part --------------
HTML����������������������������...
Download 



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