Class: DerivedImages::Processor
- Inherits:
-
Object
- Object
- DerivedImages::Processor
- Defined in:
- lib/derived_images/processor.rb
Overview
Instance Method Summary collapse
-
#initialize ⇒ Processor
constructor
A new instance of Processor.
- #run_once ⇒ Object
- #unwatch ⇒ Object
- #watch ⇒ Object
Constructor Details
#initialize ⇒ Processor
Returns a new instance of Processor.
7 8 9 10 11 12 |
# File 'lib/derived_images/processor.rb', line 7 def initialize @cache = Cache.new @manifest = Manifest.new.tap(&:draw) @queue = Thread::Queue.new @workers = ThreadGroup.new end |
Instance Method Details
#run_once ⇒ Object
25 26 27 28 29 |
# File 'lib/derived_images/processor.rb', line 25 def run_once process_all queue.close @workers.list.each(&:join) end |
#unwatch ⇒ Object
20 21 22 23 |
# File 'lib/derived_images/processor.rb', line 20 def unwatch manifest_listener&.stop image_listener&.stop end |
#watch ⇒ Object
14 15 16 17 18 |
# File 'lib/derived_images/processor.rb', line 14 def watch watch_manifest watch_images process_all end |