Class: Fluent::GroongaInput::GQTPInput::Handler

Inherits:
Coolio::Socket
  • Object
show all
Defined in:
lib/fluent/plugin/in_groonga.rb

Instance Method Summary collapse

Constructor Details

#initialize(socket, input) ⇒ Handler

Returns a new instance of Handler.



264
265
266
267
# File 'lib/fluent/plugin/in_groonga.rb', line 264

def initialize(socket, input)
  super(socket)
  @input = input
end

Instance Method Details

#on_closeObject



279
280
281
# File 'lib/fluent/plugin/in_groonga.rb', line 279

def on_close
  @parser.close
end

#on_connectObject



269
270
271
272
# File 'lib/fluent/plugin/in_groonga.rb', line 269

def on_connect
  @parser = Parser.new(@input)
  @repeater = @input.create_repeater(self)
end

#on_read(data) ⇒ Object



274
275
276
277
# File 'lib/fluent/plugin/in_groonga.rb', line 274

def on_read(data)
  @parser << data
  @repeater.write(data)
end