Class: SassListen::Event::Processor

Inherits:
Object
  • Object
show all
Defined in:
lib/sass-listen/event/processor.rb

Defined Under Namespace

Classes: Stopped

Instance Method Summary collapse

Constructor Details

#initialize(config, reasons) ⇒ Processor

Returns a new instance of Processor.



4
5
6
7
8
# File 'lib/sass-listen/event/processor.rb', line 4

def initialize(config, reasons)
  @config = config
  @reasons = reasons
  _reset_no_unprocessed_events
end

Instance Method Details

#loop_for(latency) ⇒ Object

TODO: implement this properly instead of checking the state at arbitrary points in time



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/sass-listen/event/processor.rb', line 12

def loop_for(latency)
  @latency = latency

  loop do
    _wait_until_events
    _wait_until_events_calm_down
    _wait_until_no_longer_paused
    _process_changes
  end
rescue Stopped
  SassListen::Logger.debug('Processing stopped')
end