[Groonga-commit] droonga/fluent-plugin-droonga at e6afaf9 [master] Remove unnecessary methods.

Back to archive index

Daijiro MORI null+****@clear*****
Thu Sep 5 23:00:53 JST 2013


Daijiro MORI	2013-09-05 23:00:53 +0900 (Thu, 05 Sep 2013)

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

  Message:
    Remove unnecessary methods.

  Modified files:
    lib/droonga/proxy.rb

  Modified: lib/droonga/proxy.rb (+10 -35)
===================================================================
--- lib/droonga/proxy.rb    2013-09-05 21:59:12 +0900 (5c67f4f)
+++ lib/droonga/proxy.rb    2013-09-05 23:00:53 +0900 (8c430a9)
@@ -337,46 +337,21 @@ module Droonga
   class ProxyHandler < Droonga::Handler
     attr_reader :task, :input_name, :component, :output_values, :body, :output_names
     def handle(command, request, *arguments)
+      return false unless request.is_a? Hash
       @task = request["task"]
-      @input_name = request["name"]
+      return false unles****@task*****_a? Hash
       @component = @task["component"]
-      @output_names = @component["outputs"]
-      @body = @component["body"]
+      return false unles****@compo*****_a? Hash
       @output_values = @task["values"]
-      @descendants = request["descendants"]
+      @body = @component["body"]
+      @output_names = @component["outputs"]
       @id = request["id"]
-      invoke(command, request["value"], *arguments)
+      @value = request["value"]
+      @input_name = request["name"]
+      @descendants = request["descendants"]
+      invoke(command, @value, *arguments)
       output if @descendants
-    end
-
-    def emit(value, name = nil)
-      unless name
-        if @output_names
-          name = @output_names.first
-        else
-          @task["values"] = value
-          return
-        end
-      end
-      @task["values"][name] = value
-    end
-
-    def output
-      result = @task["values"]
-      post = component["post"]
-      post(result, post) if post
-      @descendants.each do |name, dests|
-        message = {
-          "id" => @id,
-          "input" => name,
-          "value" => result[name]
-        }
-        dests.each do |routes|
-          routes.each do |route|
-            post(message, "to"=>route, "type"=>"proxy")
-          end
-        end
-      end
+      true
     end
 
     def prefer_synchronous?(command)
-------------- next part --------------
HTML����������������������������...
Download 



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