Class: Fluent::PingMessageInput
- Inherits:
-
Input
- Object
- Input
- Fluent::PingMessageInput
- Includes:
- Mixin::ConfigPlaceholders
- Defined in:
- lib/fluent/plugin/in_ping_message.rb
Instance Method Summary collapse
Instance Method Details
#pingloop ⇒ Object
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/fluent/plugin/in_ping_message.rb', line 38 def pingloop @last_checked = Fluent::Engine.now loop do sleep 0.5 if Fluent::Engine.now - @last_checked >= @interval @last_checked = Fluent::Engine.now router.emit(@tag, Fluent::Engine.now, {'data' => @data}) end end end |
#shutdown ⇒ Object
28 29 30 31 32 |
# File 'lib/fluent/plugin/in_ping_message.rb', line 28 def shutdown super @loop.terminate @loop.join end |
#start ⇒ Object
23 24 25 26 |
# File 'lib/fluent/plugin/in_ping_message.rb', line 23 def start super start_pingloop end |
#start_pingloop ⇒ Object
34 35 36 |
# File 'lib/fluent/plugin/in_ping_message.rb', line 34 def start_pingloop @loop = Thread.new(&method(:pingloop)) end |