Class: PerfectSched::Application::Dispatch
- Extended by:
- PerfectQueue::Application::RouterDSL
- Defined in:
- lib/perfectsched/application/dispatch.rb
Instance Attribute Summary collapse
-
#runner ⇒ Object
readonly
Returns the value of attribute runner.
Attributes inherited from Runner
Instance Method Summary collapse
-
#initialize(task) ⇒ Dispatch
constructor
Runner interface.
- #run ⇒ Object
Methods inherited from Runner
Constructor Details
#initialize(task) ⇒ Dispatch
Runner interface
24 25 26 27 28 29 30 31 32 |
# File 'lib/perfectsched/application/dispatch.rb', line 24 def initialize(task) base = self.class.router.route(task.type) unless base task.retry! raise "Unknown task type #{task.type.inspect}" # TODO error class end @runner = base.new(task) super end |
Instance Attribute Details
#runner ⇒ Object (readonly)
Returns the value of attribute runner.
34 35 36 |
# File 'lib/perfectsched/application/dispatch.rb', line 34 def runner @runner end |
Instance Method Details
#run ⇒ Object
36 37 38 |
# File 'lib/perfectsched/application/dispatch.rb', line 36 def run @runner.run end |