Skip to content

Instantly share code, notes, and snippets.

@nu7hatch
Created August 4, 2010 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nu7hatch/508715 to your computer and use it in GitHub Desktop.
Save nu7hatch/508715 to your computer and use it in GitHub Desktop.
Resque with ActionMailer
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