Class: Listen::Adapters::Polling

Inherits:
Listen::Adapter show all
Defined in:
lib/listen/adapters/polling.rb

Overview

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.

Constant Summary

Constants inherited from Listen::Adapter

Listen::Adapter::DEFAULT_LATENCY, Listen::Adapter::POLLING_FALLBACK_MESSAGE

Instance Attribute Summary

Attributes inherited from Listen::Adapter

#latency

Instance Method Summary collapse

Methods inherited from Listen::Adapter

select_and_initialize

Constructor Details

#initialize(directory, options = {}, &callback) ⇒ Polling

Initialize the Adapter. See Listen::Adapter#initialize for more info.



16
17
18
19
# File 'lib/listen/adapters/polling.rb', line 16

def initialize(directory, options = {}, &callback)
  @latency ||= DEFAULT_POLLING_LATENCY
  super
end

Instance Method Details

#startObject

Start the adapter.



23
24
25
26
# File 'lib/listen/adapters/polling.rb', line 23

def start
  super
  poll
end

#stopObject

Stop the adapter.



30
31
32
# File 'lib/listen/adapters/polling.rb', line 30

def stop
  super
end