class Fluent::HttpHeartbeatInput

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/fluent/plugin/in_http_heartbeat.rb, line 23
def initialize
  super
  require 'cool.io'
  require 'fluent/input'
end

Public Instance Methods

run() click to toggle source
# File lib/fluent/plugin/in_http_heartbeat.rb, line 63
def run
  @loop.run()
rescue
  log.error "unexpected error", error: $!.to_s
  log.error_backtrace
end
shutdown() click to toggle source
# File lib/fluent/plugin/in_http_heartbeat.rb, line 57
def shutdown
  @loop.stop
  @server.close
  @thread.join
end
start() click to toggle source
Calls superclass method
# File lib/fluent/plugin/in_http_heartbeat.rb, line 46
def start
  super

  log.debug "listening http on #{@bind}:#{@port}"
  @server = Cool.io::TCPServer.new(@bind, @port, HeartbeatConnection)
  @loop = Coolio::Loop.new
  @loop.attach(@server)
  
  @thread = Thread.new(&method(:run))
end