Sha256: f56abeb839d44458323007c70e266f1c93c35096524e6d032de3e44276d78acd
Contents?: true
Size: 525 Bytes
Versions: 1
Compression:
Stored size: 525 Bytes
Contents
module FSSM::Backends class Polling def initialize(options={}) @handlers = [] @latency = options[:latency] || 1 end def add_path(path, preload=true) @handlers << FSSM::State.new(path, preload) end def run begin loop do start = Time.now.to_f @handlers.each {|handler| handler.refresh} nap_time = @latency - (Time.now.to_f - start) sleep nap_time if nap_time > 0 end rescue Interrupt end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
chriseppstein-compass-0.8.14 | lib/vendor/fssm/backends/polling.rb |