Class: Grntest::Executors::HTTPExecutor
- Inherits:
-
BaseExecutor
- Object
- BaseExecutor
- Grntest::Executors::HTTPExecutor
- Defined in:
- lib/grntest/executors/http-executor.rb
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.
25 26 27 28 29 |
# File 'lib/grntest/executors/http-executor.rb', line 25 def initialize(host, port, context) super(context) @host = host @port = port end |
Instance Method Details
#create_sub_executor(context) ⇒ Object
51 52 53 |
# File 'lib/grntest/executors/http-executor.rb', line 51 def create_sub_executor(context) self.class.new(@host, @port, context) end |
#ensure_groonga_ready ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/grntest/executors/http-executor.rb', line 39 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
31 32 33 34 35 36 37 |
# File 'lib/grntest/executors/http-executor.rb', line 31 def send_command(command) if command.name == "load" send_load_command(command) else send_normal_command(command) end end |