Dave Hoover has just written an article posted on RubyLearning.com that's worth a read.
Dave’s blog post takes a look at running background jobs through Resque (pronounced "rescue"). Resque, developed at Github and built on top of Redis, lets you create a job, put it in a queue, and then later down the road, go back to those jobs and process them. It basically lets developers write a fast-running Ruby program that figures out what work needs to be done, tells someone else to do it, and then exits.
Dave walks you through the process of writing the code telling Resque to queue a job, getting Resque in place, then getting a worker to listen in on all of the Resque queues. A Sinatra app lets you watch the activity between the queues and the workers.
It's worthwhile to spend a few minutes reviewing Dave’s RubyLearning post and get familiar with the Resque background job system.