Resque Result
A Resque plugin. Requires Resque 1.8.
If you want to be able fetch the result from a Resque job's perform method. Results will be encoded using JSON.
For example:
require 'resque-result'
class MyJob
extend Resque::Plugins::Result
def self.perform(, big_num)
factor(big_num)
end
end
= MyJob.enqueue(3574406403731)
.enqueued_at # => 'Wed May 19 13:42:41 -0600 2010'
. # => '03c9e1a045ad012dd20500264a19273c'
# later
= MyJob.('03c9e1a045ad012dd20500264a19273c')
.succeeded? # => true
.result # => [ 1299709, 2750159 ]