Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A resque plugin to add metadata to your jobs

tree: d1037c9f2f

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 resque-meta.gemspec
README.md

Resque Meta

A Resque plugin. Requires Resque 1.8.

If you want to be able to add metadata for a job to track anything you want, extend it with this module.

For example:

class MyJob
  extend Resque::Jobs::Meta

  def self.perform(meta_id, *args)
    heavy_lifting
  end
end

meta0 = MyJob.enqueue('stuff')
meta0.enqueued_at # => 'Wed May 19 13:42:41 -0600 2010'
meta0.meta_id # => '03c9e1a045ad012dd20500264a19273c'
meta0['foo'] = 'bar' # => 'bar'

# later
meta1 = MyJob.get_meta('03c9e1a045ad012dd20500264a19273c')
meta1.job_class # => MyJob
meta1.enqueued_at # => 'Wed May 19 13:42:41 -0600 2010'
meta1['foo'] # => 'bar'
Something went wrong with that request. Please try again.