Like Ryan Sonnek, I’ve dabbled with a few different ways to run background processes in my Ruby apps, even resorting to knocking together my own (far from perfect) solution. As Ryan says on his blog, many popular libraries have complicated interfaces and don’t “feel right”.
I tend to disagree, however, with his statement that every ruby background job solution sucks, and I’m sure he doesn’t really mean it. Although his offering, Backgrounded, is refreshingly simple and concise, it’s effectively just a wrapper for other solutions.
With Backgrounded, if you want a certain method to always run in the background, you can specify it like this:
class User
backgrounded :do_stuff
def do_stuff
# do all your work here
end
end
…and then just call that method in the normal way. Read More