Polling Adapter that works cross-platform and has no dependencies. This is the adapter that uses the most CPU processing power and has higher file IO that the other implementations.
Initialize the Adapter. See {Listen::Adapter#initialize} for more info.
# File lib/listen/adapters/polling.rb, line 16 def initialize(directories, options = {}, &callback) @latency ||= DEFAULT_POLLING_LATENCY super end
Start the adapter.
@param [Boolean] blocking whether or not to block the current thread after starting
# File lib/listen/adapters/polling.rb, line 25 def start(blocking = true) @mutex.synchronize do return if @stop == false super end @poll_thread = Thread.new { poll } @poll_thread.join if blocking end
Generated with the Darkfish Rdoc Generator 2.