Class: Fluent::HttpHeartbeatInput
- Inherits:
-
Input
- Object
- Input
- Fluent::HttpHeartbeatInput
show all
- Defined in:
- lib/fluent/plugin/in_http_heartbeat.rb
Defined Under Namespace
Classes: HeartbeatConnection
Instance Method Summary
collapse
Constructor Details
Returns a new instance of HttpHeartbeatInput.
23
24
25
26
27
|
# File 'lib/fluent/plugin/in_http_heartbeat.rb', line 23
def initialize
super
require 'cool.io'
require 'fluent/input'
end
|
Instance Method Details
#run ⇒ Object
63
64
65
66
67
68
|
# 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 ⇒ Object
57
58
59
60
61
|
# File 'lib/fluent/plugin/in_http_heartbeat.rb', line 57
def shutdown
@loop.stop
@server.close
@thread.join
end
|
#start ⇒ Object
46
47
48
49
50
51
52
53
54
55
|
# 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
|