Class: Operations::Task::Runner
- Inherits:
-
Object
- Object
- Operations::Task::Runner
- Defined in:
- app/models/operations/task/runner.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Runner
constructor
A new instance of Runner.
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize ⇒ Runner
Returns a new instance of Runner.
3 4 5 |
# File 'app/models/operations/task/runner.rb', line 3 def initialize @stopped = false end |
Class Method Details
.start ⇒ Object
24 |
# File 'app/models/operations/task/runner.rb', line 24 def self.start = new.start |
Instance Method Details
#start ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/models/operations/task/runner.rb', line 7 def start puts "Starting #{self.class.name}" register_signal_handlers puts "...signal handlers registered" until @stopped Rails.application.eager_load! if Rails.env.development? # Ensure all sub-classes are loaded in dev mode Task.wake_sleeping Task.delete_old sleep 30 end puts "...stopping" end |
#stop ⇒ Object
20 21 22 |
# File 'app/models/operations/task/runner.rb', line 20 def stop @stopped = true end |