Skip to content
nesquena edited this page Nov 9, 2012 · 5 revisions

First, you probably want to install beanstalkd, which powers the job queues. Depending on your platform, this should be as simple as (for Ubuntu):

$ sudo apt-get install beanstalkd

Add this line to your application's Gemfile:

gem 'backburner'

And then execute:

$ bundle

Or install it yourself as:

$ gem install backburner

Configuration

Backburner is extremely simple to setup. Just configure basic settings for backburner:

Backburner.configure do |config|
  config.beanstalk_url    = ["beanstalk://127.0.0.1", "..."]
  config.tube_namespace   = "some.app.production"
  config.on_error         = lambda { |e| puts e }
  config.max_job_retries  = 3 # default 0 retries
  config.retry_delay      = 2 # default 5 seconds
  config.default_priority = 65536
  config.respond_timeout  = 120
  config.default_worker   = Backburner::Workers::Simple
  config.logger           = Logger.new(STDOUT)
end

The key options available are:

Option Description
beanstalk_url Address such as 'beanstalk://127.0.0.1' or an array of addresses.
tube_namespace Prefix used for all tubes related to this backburner queue.
on_error Lambda invoked with the error whenever any job in the system fails.
default_worker Worker class that will be used if no other worker is specified.
max_job_retries Integer defines how many times to retry a job before burying.
retry_delay Integer defines the base time to wait (in secs) between job retries.
logger Logger recorded to when backburner wants to report info or errors.
Clone this wiki locally