Class: WarmingDrawer::Workers::BaseWorker
- Inherits:
-
Object
- Object
- WarmingDrawer::Workers::BaseWorker
- Defined in:
- lib/warming_drawer/workers/base_worker.rb
Direct Known Subclasses
Class Method Summary collapse
- .options(options_hash) ⇒ Object
-
.perform_with(*args) ⇒ Object
Sets up perform with or without queue.
- .perform_with_queue(*args) ⇒ Object
- .perform_without_queue(*args) ⇒ Object
Instance Method Summary collapse
-
#perform(*args) ⇒ Object
Does the actual work.
Class Method Details
.options(options_hash) ⇒ Object
16 17 18 19 |
# File 'lib/warming_drawer/workers/base_worker.rb', line 16 def () # TODO: change this based on queuing system end |
.perform_with(*args) ⇒ Object
Sets up perform with or without queue
8 9 10 11 12 13 14 |
# File 'lib/warming_drawer/workers/base_worker.rb', line 8 def perform_with(*args) if WarmingDrawer.use_queue? perform_with_queue(args) else perform_without_queue(args) end end |
.perform_with_queue(*args) ⇒ Object
21 22 23 24 |
# File 'lib/warming_drawer/workers/base_worker.rb', line 21 def perform_with_queue(*args) # TODO: change this based on queuing system perform_async(args) end |
.perform_without_queue(*args) ⇒ Object
26 27 28 |
# File 'lib/warming_drawer/workers/base_worker.rb', line 26 def perform_without_queue(*args) new.perform(args) end |
Instance Method Details
#perform(*args) ⇒ Object
Does the actual work
33 34 35 |
# File 'lib/warming_drawer/workers/base_worker.rb', line 33 def perform(*args) raise 'Override perform in your worker' end |