null+****@clear*****
null+****@clear*****
2012年 6月 6日 (水) 16:48:43 JST
Haruka Yoshihara 2012-06-06 16:48:43 +0900 (Wed, 06 Jun 2012)
New Revision: f28435760185b6a0df5d533ac7719c50a7d4ac13
Log:
Create executor for HTTP
But it's not worked yet.
Modified files:
lib/groonga/tester.rb
Modified: lib/groonga/tester.rb (+19 -5)
===================================================================
--- lib/groonga/tester.rb 2012-06-06 16:45:07 +0900 (2d59ee7)
+++ lib/groonga/tester.rb 2012-06-06 16:48:43 +0900 (af8224d)
@@ -304,7 +304,7 @@ module Groonga
groonga_input = input_pipe[write]
groonga_output = output_pipe[read]
ensure_groonga_ready(groonga_input, groonga_output)
- executor = Executor.new(groonga_input, groonga_output, context)
+ executor = GQTPExecutor.new(groonga_input, groonga_output, context)
yield(executor)
ensure
(input_pipe + output_pipe).each do |io|
@@ -332,7 +332,7 @@ module Groonga
begin
open("http://#{host}:#{port}/d/status") do
end
- executor = Executor.new(host, port, context)
+ executor = HTTPExecutor.new(host, port, context)
yield(executor)
ensure
open("http://#{host}:#{port}/d/shutdown") do
@@ -473,9 +473,7 @@ module Groonga
end
attr_reader :context
- def initialize(input, output, context=nil)
- @input = input
- @output = output
+ def initialize(context=nil)
@loading = false
@pending_command = ""
@current_command_name = nil
@@ -662,6 +660,22 @@ module Groonga
end
end
+ class GQTPExecutor < Executor
+ def initialize(input, output, context=nil)
+ super(context)
+ @input = input
+ @output = output
+ end
+ end
+
+ class HTTPExecutor < Executor
+ def initialize(host, port, context=nil)
+ super(context)
+ @host = host
+ @port = port
+ end
+ end
+
class CommandFormatConverter
def initialize(gqtp_command)
@gqtp_command = gqtp_command