Class: Fluent::ZabbixAgentInput::TimerWatcher

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of TimerWatcher.



165
166
167
168
169
# File 'lib/fluent/plugin/in_zabbix_agent.rb', line 165

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

Instance Method Details

#on_timerObject



171
172
173
174
175
176
# File 'lib/fluent/plugin/in_zabbix_agent.rb', line 171

def on_timer
  @callback.call
rescue => e
  @log.error(e.message)
  @log.error_backtrace(e.backtrace)
end