Created
August 4, 2010 20:15
-
-
Save nu7hatch/508715 to your computer and use it in GitHub Desktop.
Resque with ActionMailer
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
class Notifier < ActionMailer::Base | |
def self.perform(method, *args) | |
#self.send(method, *args).deliver | |
self.send("deliver_#{method}", *args) | |
end | |
def some_notification(user) | |
# ... | |
end | |
def some_async_notification(user) | |
Resque.enqueue(self.class, :some_notification, user) | |
end | |
end | |
Notifier.some_async_notification(User.first) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment