class Fluent::ConfigReloaderOutput::ReloadFileWatcher
Attributes
thread[R]
Public Class Methods
create(observer, watch_file, interval)
click to toggle source
# File lib/fluent/plugin/out_config_reloader.rb, line 15 def self.create(observer, watch_file, interval) obj = self.new obj.add_observer(observer) obj.watch watch_file, interval obj end
Public Instance Methods
watch(watch_file, interval)
click to toggle source
# File lib/fluent/plugin/out_config_reloader.rb, line 23 def watch watch_file, interval mtime = Time.now @thread = Thread.new do loop do if File.exists?(watch_file) && File.mtime(watch_file) > mtime mtime = File.mtime(watch_file) changed notify_observers end sleep interval end end end