Class: NginxTimer::TimerWatcher

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of TimerWatcher.



19
20
21
22
23
# File 'lib/fluent/plugin/in_nginx.rb', line 19

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

Instance Method Details

#on_timerObject



25
26
27
28
29
30
31
32
# File 'lib/fluent/plugin/in_nginx.rb', line 25

def on_timer
  @callback.call

rescue
  # TODO log?
  @log.error $!.to_s
  @log.error_backtrace
end