Skip to content

Instantly share code, notes, and snippets.

@bradleybuda
Last active December 13, 2015 22:58
Show Gist options
  • Select an option

  • Save bradleybuda/4987887 to your computer and use it in GitHub Desktop.

Select an option

Save bradleybuda/4987887 to your computer and use it in GitHub Desktop.
module Resque::Plugins::Status::Hash
def self.generate_uuid
require 'uuid' unless defined?(UUID)
UUID.generate(:compact)
end
end
module Resque::Plugins::Status::ClassMethods
def enqueue(klass, options = {})
uuid = Resque::Plugins::Status::Hash.generate_uuid
if Resque.enqueue(klass, uuid, options)
Resque::Plugins::Status::Hash.create uuid, :options => options
uuid
else
nil
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment