Created
October 8, 2012 18:17
-
-
Save corny/3854016 to your computer and use it in GitHub Desktop.
Resque Helpers
This file contains 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 AsyncHelper | |
extend ActiveSupport::Concern | |
module ClassMethods | |
def perform(id, method, *args) | |
find(id).send(method, *args) | |
end | |
end | |
def async(method, *args) | |
Resque.enqueue(self.class, id, method, *args) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment