Class: Fluent::TimerWatcher

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

Overview

class for handling interval in loop

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of TimerWatcher.



173
174
175
176
# File 'lib/fluent/plugin/in_spectrum.rb', line 173

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

Instance Method Details

#on_timerObject

def initialize



177
178
179
# File 'lib/fluent/plugin/in_spectrum.rb', line 177

def on_timer
  @callback.call
end