Resque is great, but the README.md on github (as of 12/1/2014) continues to cause butthurt to folks who are trying to setup resque.
The current README (wrongly) states:
To define some work, make a job. Jobs need a work
method:
class ImageConversionJob
def work
# convert some kind of image here
end
end
Next, we need to procrastinate! Let's put your job on the queue:
resque = Resque.new
resque << ImageConversionJob.new
Here is the "correct" example usage:
Be sure that your job has a queue method so that Resque knows where to put it
class ImageConversionJob
class << self
def queue
"default"
end
def work
# convert some kind of image here
end
alias_method :perform, :work # the old API takes perform, but the new one will use work
end
end
Next, we need to procrastinate! Let's put your job on the queue:
Resque.enqueue ImageConversionJob
Presumably, whenever resque 2.0 comes out in the not-so-distant future, we'd be able to do Resque.new and whatnot, but for now, this gist is here to hopefully save folks today some time and butt hurt.