resque
Post on 16-Jan-2015
1.168 Views
Preview:
DESCRIPTION
TRANSCRIPT
Resque
AsynchronousProcessing
Two popular options
• DelayedJob
• Resque
DelayedJob
• http://github.com/tobi/delayed_job
• ActiveRecord based
• BatchImporter.new(Shop.find(1)).send_later(:import_massive_csv, massive_csv)
Resque
• http://github.com/defunkt/resque
• Redis based
• Battle tested at GitHub
Usageclass Converter @queue = :conversion
def self.perform(id) ... endend
Resque.enqueue(Converter, 123)
Invoking
QUEUE=:conversion rake environment resque:work
Sample App
• http://github.com/joerichsen/resque_demo
Misc
• MySQL has gone away - http://axonflux.com/resque-to-the-rescue-but-a-gotcha-dont-forget
• Deployment and Capistrano
• Priorities
• Namespaces
Mailers specifically
• http://github.com/zapnap/resque_mailer
• http://github.com/andersondias/delayed_job_mailer
top related