Easy Long-Running Tasks In Rails

The Old Sessions House

Contains 80 Ruby programmers

On Monday night I spoke at the London Ruby User Group on handling long-running tasks in Rails. No fights broke out so I considered it a success.

In a month or so, I’ll return to my people and give an expanded version at Scotland on Rails. The skepticism and incredulity I encountered at LRUG will guide me as I hone my material.

I’m not posting my slides because, by design, they make no sense on their own. If you’d like them anyway, get in touch and I’ll send them to you.

Incidentally, for anyone who was there, my conclusion was: Background Job, also known as BJ, by Ara T Howard.

Here’s an example of using BJ to upload files to Amazon S3 via attachment_fu.

Andy Stewart, 14 March 2008

Posted in Rails


  1. What about: http://backgroundrb.rubyforge.org/ ?

    Peter
    29 March 2008
  2. Peter, BackgrounDRb is always worth considering. It's one of the few tools, if not the only one, that supports scheduling, and of course it's been around for a while.

    On the other hand, it's quite "heavy": there's a learning curve, some configuration is required, and your worker classes must subclass BackgrounDRb classes.

    All these tools make different trade-offs, and what suits one situation better may not suit another as well. I have always found BackgroundJob to work best for me. Your experience may well differ.

    Andy Stewart
    29 March 2008

Have your say

You can use Markdown in your comments. If you want to post code, do this:

<pre><code class="ruby|javascript|css|html">your code here</code></pre>

Thanks!