Dedicating a DJ(Delayed job) worker to a specific queue in heroku.

Let’s say you have a vey important procedure that takes a while, and you need to process it in background, but you still want to execute ASAP. I’m using Delayed Job on Heroku, and could not find a lot of tutorials to do this simple task. So here is the simplest way to achieve this ability, you can raise a process/daemon that will have only one queue to work on. (Dealyed job worker by default is queue agnostic, just process all jobs) In procfile: urgentworker: QUEUE=urgent bundle exec rake jobs:work You can call the worker in any name you want and even define multiple workers for multiple queues. And in the “urgent” job just define the queue name to be “urgent” the worker will process only jobs in this queue. example: handle_asynchronously :some_job, :queue => “urgent’ This will also work for Resque. Notice that for rescue you can write QUEUE=* but for delayed job you can’t.

November 15, 2014 · 1 min · Chen Kinnrot

Rails + Mongo + Heroku how?

After a few hours of fighting with google I decided to write it all here: *This post is more relevant for windows users but can help others. What do you need to have: First you need to have ruby 1.9.2+ Devkit then you need rails 3+ then u need the bundler gem then go to getting started with mongoid then install mongo locally then check it all good then add account in heroku then create app then add your key then push

March 28, 2012 · 1 min · Chen Kinnrot