[Groonga-commit] groonga/fluent-plugin-groonga [master] out: use Cool.io based GQTP client

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Nov 28 17:45:38 JST 2012


Kouhei Sutou	2012-11-28 17:45:38 +0900 (Wed, 28 Nov 2012)

  New Revision: 4818734df878a28c51e8ef49d5fad205e04bcb1e
  https://github.com/groonga/fluent-plugin-groonga/commit/4818734df878a28c51e8ef49d5fad205e04bcb1e

  Log:
    out: use Cool.io based GQTP client

  Modified files:
    lib/fluent/plugin/out_groonga.rb

  Modified: lib/fluent/plugin/out_groonga.rb (+13 -3)
===================================================================
--- lib/fluent/plugin/out_groonga.rb    2012-11-28 15:45:15 +0900 (f2268f6)
+++ lib/fluent/plugin/out_groonga.rb    2012-11-28 17:45:38 +0900 (173f1c8)
@@ -121,17 +121,27 @@ module Fluent
       config_param :port, :integer, :default => 10041
 
       def start
-        @client = GQTP::Client.new(:host => @host,
-                                   :port => @port,
-                                   :connection => :synchronous)
+        @loop = Coolio::Loop.new
+        @client = nil
       end
 
       def shutdown
+        return if****@clien*****?
+        @client.send("shutdown") do
+          @loop.stop
+        end
+        @loop.run
       end
 
       def send(command)
+        @client ||= GQTP::Client.new(:host => @host,
+                                     :port => @port,
+                                     :connection => :coolio,
+                                     :loop => @loop)
         @client.send(command.to_command_format) do |header, body|
+          @loop.stop
         end
+        @loop.run
       end
     end
 
-------------- next part --------------
HTML����������������������������...
Download 



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