Class: Fluent::StormInput::TimerWatcher

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of TimerWatcher.



90
91
92
93
94
# File 'lib/fluent/plugin/in_storm.rb', line 90

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

Instance Method Details

#on_timerObject



96
97
98
99
100
101
# File 'lib/fluent/plugin/in_storm.rb', line 96

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