Class: Grntest::Executors::HTTPExecutor
- Inherits:
-
BaseExecutor
- Object
- BaseExecutor
- Grntest::Executors::HTTPExecutor
- Defined in:
- lib/grntest/executors/http-executor.rb
Defined Under Namespace
Classes: SlowBodyStream
Instance Attribute Summary
Attributes inherited from BaseExecutor
Instance Method Summary collapse
- #create_sub_executor(context) ⇒ Object
- #ensure_groonga_ready ⇒ Object
-
#initialize(host, port, context) ⇒ HTTPExecutor
constructor
A new instance of HTTPExecutor.
- #send_command(command) ⇒ Object
Methods inherited from BaseExecutor
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_ready ⇒ Object
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 @raw_status_response = 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 |