Spinning Off Asynch Rails Processes For Web Services Calls

When making Web Services call from your Ruby On Rails WebApp, you'll want to spin those off as ASynch calls to insulate the user from slow/timeout cases. (Flip-side risk: if the Web Services call gets rejected because of data quality, you've lost the chance to have the user make a fix.)

There are lots of choices. So I won't point at any directly here, but go meta.

Nov'2009: GitHub announces the Redis-backed Res Que which they built after using a lot of other libraries (so read this piece for issues they ran into with each). I highly recommend Delayed Job to anyone whose site is not 50% background work.

Mar'2010: a good piece that takes a broader look at different use-cases, and breaks down the options by a couple categories.

Another key use-case for ASynch work is sending EMail-s from your WebApp.

  • May'2008 post notes We have just released a new rails plugin called workling_mailer. This plugin provides a module which – when included into an Action Mailer subclass – pushes all emails that would normally be delivered synchronously into a queue for asynchronous processing. For queuing it relies on the workling plugin which can use for example TwittEr’s Star Ling as a queue server.

  • Nov'2010 details on setting up Action Mailer with Delayed Job.

  • This post notes Resque Mailer is super simple to configure and run. Resque (the Resque in Resque Mailer is a Gem itself) use Redis for persistence and worker processes information handling.

  • Mad Mimi is a non-free library for Email Marketing that uses Res Que.

Edited: |

blog comments powered by Disqus