Class: Fluent::HttpHeartbeatInput::HeartbeatConnection

Inherits:
Cool.io::TCPSocket
  • Object
show all
Defined in:
lib/fluent/plugin/in_http_heartbeat.rb

Instance Method Summary collapse

Instance Method Details

#on_read(data) ⇒ Object



30
31
32
33
34
35
36
37
38
39
# File 'lib/fluent/plugin/in_http_heartbeat.rb', line 30

def on_read(data)
  body = "heartbeat"

  response = "HTTP/1.1 200\r\n"
  response << "Content-type: text/plain\r\n"
  response << "Content-length: " + body.bytesize.to_s + "\r\n"
  response << "\r\n"
  response << body
  write response
end

#on_write_completeObject



41
42
43
# File 'lib/fluent/plugin/in_http_heartbeat.rb', line 41

def on_write_complete
  close
end