Class: Grntest::Executors::HTTPExecutor

Inherits:
BaseExecutor show all
Defined in:
lib/grntest/executors/http-executor.rb

Defined Under Namespace

Classes: SlowBodyStream

Instance Attribute Summary

Attributes inherited from BaseExecutor

#context

Instance Method Summary collapse

Methods inherited from BaseExecutor

#execute, #shutdown

Constructor Details

#initialize(host, port, context) ⇒ HTTPExecutor

Returns a new instance of HTTPExecutor.



47
48
49
50
51
# File 'lib/grntest/executors/http-executor.rb', line 47

def initialize(host, port, context)
  super(context)
  @host = host
  @port = port
end

Instance Method Details

#create_sub_executor(context) ⇒ Object



73
74
75
# File 'lib/grntest/executors/http-executor.rb', line 73

def create_sub_executor(context)
  self.class.new(@host, @port, context)
end

#ensure_groonga_readyObject



61
62
63
64
65
66
67
68
69
70
71
# File 'lib/grntest/executors/http-executor.rb', line 61

def ensure_groonga_ready
  n_retried = 0
  begin
    send_command(command("status"))
  rescue Error
    n_retried += 1
    sleep(0.1)
    retry if n_retried < 100
    raise
  end
end

#send_command(command) ⇒ Object



53
54
55
56
57
58
59
# File 'lib/grntest/executors/http-executor.rb', line 53

def send_command(command)
  if command.name == "load"
    send_load_command(command)
  else
    send_normal_command(command)
  end
end