Class: Fluent::Counter::Handler

Inherits:
BaseSocket
  • Object
show all
Defined in:
lib/fluent/counter/server.rb

Instance Method Summary collapse

Methods inherited from BaseSocket

#on_read, #packed_write

Constructor Details

#initialize(io, on_message) ⇒ Handler

Returns a new instance of Handler.



262
263
264
265
# File 'lib/fluent/counter/server.rb', line 262

def initialize(io, on_message)
  super(io)
  @on_message = on_message
end

Instance Method Details

#on_message(data) ⇒ Object



267
268
269
270
# File 'lib/fluent/counter/server.rb', line 267

def on_message(data)
  res = @on_message.call(data)
  packed_write res if res
end