Last active
December 13, 2015 22:58
-
-
Save bradleybuda/4987887 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Resque::Plugins::Status::Hash | |
| def self.generate_uuid | |
| require 'uuid' unless defined?(UUID) | |
| UUID.generate(:compact) | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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