Komodo
Komodo is a simple wrapper for Delayed::Job that helps you autoscale workers when deployed on Heroku. It came about for an upcoming project of ours, which only required the occasional background worker.
Please note: This is still very early days for Komodo, there's very little (read: zero) test coverage - and we've yet to even put it into production.
Configuration
Setup delayed_job as per the instructions on Heroku.
Add Komodo to your Gemfile:
gem "komodo"
Add a /config/komodo.yml
file to your Rails 3 project directory and add the following:
defaults: &defaults
max_workers: 1
application_name: my_heroku_application
username: email@myherokuapplication.com
password: sekrit
development:
<<: *defaults
test:
<<: *defaults
production:
<<: *defaults
Usage
Komodo is set up to (try and) be as abstract as possible. Queuing a function works similar to delayed_job, just call:
Komodo.queue object, :function, [arg1, arg2]
For example:
Komodo.queue @image, :resize, {:width => 900, :height => 450}
# -- or --
Komodo.queue UserMailer.send_registration_notification(@user), :deliver
Komodo will automatically add and remove workers as the queue fills up and empties, respectively.
Notes
As stated above, this is really a pre-alpha of Komodo, as such the scaling is very basic; Komodo just ramps straight up to the user-configured maximum.