Class: Fluent::TailInput::TailWatcher::TimerWatcher

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

Instance Method Summary collapse

Constructor Details

#initialize(interval, repeat, log, &callback) ⇒ TimerWatcher

Returns a new instance of TimerWatcher.



527
528
529
530
531
# File 'lib/fluent/plugin/in_tail.rb', line 527

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

Instance Method Details

#on_timerObject



533
534
535
536
537
538
539
# File 'lib/fluent/plugin/in_tail.rb', line 533

def on_timer
  @callback.call
rescue
  # TODO log?
  @log.error $!.to_s
  @log.error_backtrace
end