module TResque::Worker

Attributes

enqueued_options[R]

Public Class Methods

new(options = {}) click to toggle source
# File lib/tresque/worker.rb, line 201
def initialize(options = {})
  @enqueued_options = options.with_indifferent_access
end

Public Instance Methods

requeue() click to toggle source
# File lib/tresque/worker.rb, line 214
def requeue
  self.enqueued_options["run_at"] = nil
  delay = self.requeue_delay_seconds
  if delay > 0
    self.enqueued_options["run_at"] = delay.seconds.from_now
  end
  self.class.enqueue(self.enqueued_options)
end
requeue!() click to toggle source
# File lib/tresque/worker.rb, line 223
def requeue!
  requeue
  raise Resque::Job::DontPerform
end
requeue_delay_seconds() click to toggle source
# File lib/tresque/worker.rb, line 210
def requeue_delay_seconds
  1
end
worker_perform() click to toggle source
# File lib/tresque/worker.rb, line 205
def worker_perform
  to_call = self.enqueued_options[:action] || :work
  send(to_call)
end