Class: Fluent::Plugin::TailInput::TimerTrigger

Inherits:
Coolio::TimerWatcher
  • Object
show all
Defined in:
lib/fluent/plugin/in_tail.rb

Instance Method Summary collapse

Constructor Details

#initialize(interval, log, &callback) ⇒ TimerTrigger

Returns a new instance of TimerTrigger.



742
743
744
745
746
# File 'lib/fluent/plugin/in_tail.rb', line 742

def initialize(interval, log, &callback)
  @log = log
  @callback = callback
  super(interval, true)
end

Instance Method Details

#on_timerObject



748
749
750
751
752
753
# File 'lib/fluent/plugin/in_tail.rb', line 748

def on_timer
  @callback.call
rescue => e
  @log.error e.to_s
  @log.error_backtrace
end