Class: Fluent::ObjectSpaceInput::TimerWatcher

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of TimerWatcher.



33
34
35
36
# File 'lib/fluent/plugin/in_object_space.rb', line 33

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

Instance Method Details

#on_timerObject



38
39
40
41
42
43
44
# File 'lib/fluent/plugin/in_object_space.rb', line 38

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