Class: Fluent::GroongaOutput::NetworkClient
- Inherits:
-
BaseClient
- Object
- BaseClient
- Fluent::GroongaOutput::NetworkClient
- Includes:
- Configurable
- Defined in:
- lib/fluent/plugin/out_groonga.rb
Instance Method Summary collapse
- #execute(name, arguments = {}) ⇒ Object
-
#initialize(protocol) ⇒ NetworkClient
constructor
A new instance of NetworkClient.
- #shutdown ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(protocol) ⇒ NetworkClient
Returns a new instance of NetworkClient.
335 336 337 338 |
# File 'lib/fluent/plugin/out_groonga.rb', line 335 def initialize(protocol) super() @protocol = protocol end |
Instance Method Details
#execute(name, arguments = {}) ⇒ Object
349 350 351 352 353 354 355 356 |
# File 'lib/fluent/plugin/out_groonga.rb', line 349 def execute(name, arguments={}) command = build_command(name, arguments) @client ||= Groonga::Client.new(:protocol => @protocol, :host => @host, :port => @port, :backend => :synchronous) @client.execute(command) end |
#shutdown ⇒ Object
344 345 346 347 |
# File 'lib/fluent/plugin/out_groonga.rb', line 344 def shutdown return if @client.nil? @client.close end |
#start ⇒ Object
340 341 342 |
# File 'lib/fluent/plugin/out_groonga.rb', line 340 def start @client = nil end |