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.



232
233
234
235
# File 'lib/fluent/plugin/in_groonga.rb', line 232

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

Instance Method Details

#on_closeObject



247
248
249
# File 'lib/fluent/plugin/in_groonga.rb', line 247

def on_close
  @parser.close
end

#on_connectObject



237
238
239
240
# File 'lib/fluent/plugin/in_groonga.rb', line 237

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

#on_read(data) ⇒ Object



242
243
244
245
# File 'lib/fluent/plugin/in_groonga.rb', line 242

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