Class: Driskell::Listen::Event::Processor
- Inherits:
-
Object
- Object
- Driskell::Listen::Event::Processor
- Defined in:
- lib/driskell-listen/event/processor.rb
Defined Under Namespace
Classes: Stopped
Instance Method Summary collapse
-
#initialize(config, reasons) ⇒ Processor
constructor
A new instance of Processor.
-
#loop_for(latency) ⇒ Object
TODO: implement this properly instead of checking the state at arbitrary points in time.
Constructor Details
#initialize(config, reasons) ⇒ Processor
Returns a new instance of Processor.
4 5 6 7 8 |
# File 'lib/driskell-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/driskell-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 Driskell::Listen::Logger.debug('Processing stopped') end |