class PerfectQueue::Application::Dispatch

Attributes

runner[R]

Public Class Methods

new(task) click to toggle source

Runner interface

Calls superclass method
# File lib/perfectqueue/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

Public Instance Methods

kill(reason) click to toggle source
# File lib/perfectqueue/application/dispatch.rb, line 40
def kill(reason)
  @runner.kill(reason)
end
run() click to toggle source
# File lib/perfectqueue/application/dispatch.rb, line 36
def run
  @runner.run
end