Using Heroku and Resque in different applications

advertisements

My goal is to have a main app adding jobs to a Resque queue on Heroku. However, I want the workers to be run in different apps.

Can I enqueue a job in an app to be performed by other app(worker)? Is there any tutorial explaining how to do it?

Thanks


Resque is going to use whatever Redis instance you point it at. In Heroku, that's probably going to be an instance from the separate service Redis To Go. You just need to write your Resque setup code to point to the common Redis instance.

From http://blog.redistogo.com/2010/07/26/resque-with-redis-to-go/

uri = URI.parse(ENV["REDISTOGO_URL"])
Resque.redis = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)

This will initialize Resque with the environment variable, which you can set in each deployed Heroku app using heroku config:add REDISTOGO=etc.