Project

komodo

0.0
No commit activity in last 3 years
No release in over 3 years
Komodo is a simple wrapper that allows you to scale on-demand the number of delayed_job workers on Heroku, based on the length of your queue.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 2.1.2
~> 1.14.6
 Project Readme

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.