Class: Fluent::GroongaOutput::NetworkClient

Inherits:
BaseClient
  • Object
show all
Includes:
Configurable
Defined in:
lib/fluent/plugin/out_groonga.rb,
lib/fluent/plugin/out_groonga.rb

Instance Method Summary (collapse)

Constructor Details

- (NetworkClient) initialize(protocol)

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

- (Object) execute(name, arguments = {})



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

- (Object) shutdown



344
345
346
347
# File 'lib/fluent/plugin/out_groonga.rb', line 344

def shutdown
  return if @client.nil?
  @client.close
end

- (Object) start



340
341
342
# File 'lib/fluent/plugin/out_groonga.rb', line 340

def start
  @client = nil
end