backgrounded

Simple API for running model methods in the background

Usage

#declaration
class User
  backgrounded :do_stuff
  def do_stuff
    # do all your work here
  end
end

#usage
user = User.new
user.do_stuff_backgrounded

Installation

Command line installation

sudo gem install wireframe-backgrounded

Rails environment.rb configuration

config.gem 'wireframe-backgrounded', :source => 'http://gems.github.com', :lib => 'backgrounded'

Configuration

Packaged with both Delayed Job and JobFu handler out of the box, but can support any custom handler to perform background work.

# rails config/initializers/backgrounded.rb

# Delayed Job, see http://github.com/tobi/delayed_job/tree/master  
Backgrounded.handler = Backgrounded::Handler::DelayedJobHandler.new

# Job Fu, see http://github.com/jnstq/job_fu/tree
Backgrounded.handler = Backgrounded::Handler::JobFuHandler.new

Copyright © 2009 Ryan Sonnek. See LICENSE for details.