views:

1340

answers:

7

I know there are several plugins that do asynchronous processing. Which one is the best one and why?

The ones I know about are:

+2  A: 

BackgrounDRb - Pros: Full featured, messaging, Cons: Threaded (eek - Rails isn't thread safe!), complex

Daemon Generator - Pros: Simple, runs jobs and thats it!, Cons: None of that fancy messaging stuff.

RichH
+3  A: 

starling and workling seem pretty interesting (see the screencast) if you might have several such process, and you want to queue them.

you might also be interested by the previous screencast that use rake for background process, and by the future one that will probably be about another solution to the same question.

Rémi
This is what I ended up using, much simpler than BackgrounDRb especially with the screencast.
Otto
+3  A: 

Whether something is the 'best' solution really depends on what the problem is you're trying to solve. In some cases the best solution will be the most lightweight solution, in other the most heavyweight.

BackgroundRb is probably the most fully-featured Rails background job processor, but it's also the most complicated so will require more investment to get to grips with it. BackgroundRb can probably handle most use cases, from the simple to the complex.

I have heard very good things about Ara T. Howard's Background Job (Bj) which, to quote the README is a brain dead simple zero admin background priority queue for Rails. This is a much more lightweight solution and may be preferable to BackgroundRb for a majority of scenarios as a result.

If all you want is a solution for infrequent offline batch-style processing then script/runner which comes with all Rails apps would be more than adequate.

For further reading you might want to look at HowToRunBackgroundJobsInRails from the Rails Wiki.

Olly
+1  A: 

We use Cron. Easy to set up, easy to maintain, and it Always Works.

BackgroundRb will eat your brain.

Gwyn Morfey
+2  A: 

Starling + Workling plugin is dead simple. Plus, it uses Memcached which is simple, tested and scalable.

ismaSan
A: 

Hey,

BackgrounDRb is not threaded, its completely process based. It only has a feature of thread pools which user can use, if he wants to handle IO bound tasks concurrently.

Try 1.1 release and let me (on my blog) or on mailing list know about any issues.

+5  A: 

I'll add DJ (Delayed Job) to the list - http://blog.leetsoft.com/2008/2/17/delayed-job-dj

The github guys recently gave it a great review: http://github.com/blog/197-the-new-queue

Cameron Booth
I use DJ and it works like a charm!
huug