Class: Fluent::ForwardInput::HeartbeatRequestHandler
- Inherits:
-
Coolio::IO
- Object
- Coolio::IO
- Fluent::ForwardInput::HeartbeatRequestHandler
- Defined in:
- lib/fluent/plugin/in_forward.rb
Instance Method Summary collapse
-
#initialize(io, callback) ⇒ HeartbeatRequestHandler
constructor
A new instance of HeartbeatRequestHandler.
- #on_readable ⇒ Object
Constructor Details
#initialize(io, callback) ⇒ HeartbeatRequestHandler
Returns a new instance of HeartbeatRequestHandler.
325 326 327 328 329 |
# File 'lib/fluent/plugin/in_forward.rb', line 325 def initialize(io, callback) super(io) @io = io @callback = callback end |
Instance Method Details
#on_readable ⇒ Object
331 332 333 334 335 336 337 338 339 340 341 342 |
# File 'lib/fluent/plugin/in_forward.rb', line 331 def on_readable begin msg, addr = @io.recvfrom(1024) rescue Errno::EAGAIN, Errno::EWOULDBLOCK, Errno::EINTR return end host = addr[3] port = addr[1] @callback.call(host, port, msg) rescue # TODO log? end |