Method: Build::Files::Monitor::Polling#run

Defined in:
lib/build/files/monitor/polling.rb

#run(**options, &block) ⇒ Object



85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/build/files/monitor/polling.rb', line 85

def run(**options, &block)
  latency = options.fetch(:latency, 1.0)
  
  catch(:interrupt) do
    while true
      self.update(self.roots)
      
      yield if block_given?
      
      sleep(latency)
    end
  end
end