Skip to content

Commit

Permalink
updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
lostboy committed Feb 18, 2012
1 parent 2488caf commit 2550b0b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
26 changes: 14 additions & 12 deletions README.textile → README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
h1. Workless
[![Build Status](https://secure.travis-ci.org/lostboy/workless.png?branch=master)](http://travis-ci.org/lostboy/workless)

This is an addon for delayed_job (2.1.0.pre2) http://github.com/collectiveidea/delayed_job/tree/v2.1.0.pre2
It is designed to be used when you're using Heroku as a host and have the need to do background work with delayed job but you dont want to leave the workers running all the time as it costs money.
# Workless

This is an addon for delayed_job (> 2.0.0) http://github.com/collectiveidea/delayed_job
It is designed to be used when you're using Heroku as a host and have the need to do background work with delayed job but you don't want to leave the workers running all the time as it costs money.

You basically add the gem to your project and the rest is taken care of for you given a few CONFIG vars set on Heroku.

There are already a few of these out there, notably @mtravers' cheepnis http://github.com/mtravers/cheepnis and the autoscale branch of delayed_job by @pedro http://github.com/pedro/delayed_job/tree/autoscaling

This one takes bits from both and is helping me understand gem and plugin development. It's built for rails 3 on the delayed_job 2.1.0.pre2 tag but don't see why it wouldn't work on rails 2 as well as it hooks into the callbacks of the Delayed::Job ActiveRecord class to turn workers on and off based on the creation and destruction of jobs.
Workless takes ideas from both and is helping me understand gem and plugin development. Prior to version 1.0.0 it was originally built for rails 3 on the delayed_job 2.1.0.pre2 but since 1.0.0 is compatible with rails 2.3.x, 3.0.x, 3.1.x and 3.2.x

h2. Installation
## Installation

Add the gem to your project Gemfile and update your bundle
Add the workless gem and the delayed_job gem to your project Gemfile and update your bundle. Its is recommended to specify the gem version for delayed_job especially if you are using rails 2.3.x which doesn't work with the latest delayed_job

<pre>
gem "workless"
Expand All @@ -20,20 +22,20 @@ gem "workless"
Add your Heroku username / password as config vars to your Heroku instance, the same one you log in to Heroku with

<pre>
heroku config:add HEROKU_USER=<your username> HEROKU_PASSWORD=<your password>
heroku config:add HEROKU_USER=yourusername HEROKU_PASSWORD=yourpassword
</pre>

And for cedar apps add the app name

<pre>
heroku config:add APP_NAME=<your app name>
heroku config:add APP_NAME=yourherokuappname
</pre>

h2. Failing Jobs
## Failing Jobs

In the case of failed jobs Workless will only shut down the dj worker if all attempts have been tried. By default Delayed Job will try 25 times to process a job with ever increasing time delays between each unsucessful attempt. Because of this Workless configures Delayed Job to try failed jobs only 3 times to reduce the amount of time a worker can be running while trying to process them.

h2. Configuration
## Configuration

Workless can be disabled by using the null scaler that will ignore the workers requests to scale up and down. In an environment file add this in the config block:

Expand All @@ -55,14 +57,14 @@ The local scaler uses @adamwiggins rush library http://github.com/adamwiggins/ru

The heroku scaler works on the Aspen and Bamboo stacks while the heroku_cedar scaler only works on the new Cedar stack.

h2. Note on Patches/Pull Requests
## Note on Patches/Pull Requests

* Please fork the project, as you can see there are no tests and at present I don't know how to go about adding them so any advice would be welcome.
* Make your feature addition or bug fix.
* Commit, do not mess with rakefile, version, or history.
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
* Send me a pull request.

h2. Copyright
## Copyright

Copyright (c) 2010 lostboy. See LICENSE for details.
2 changes: 1 addition & 1 deletion workless.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Gem::Specification.new do |s|
s.description = %q{Extension to Delayed Job to enable workers to scale up when needed}
s.email = %q{paul.crabtree@gmail.com}

s.files = Dir.glob("{rails,lib}/**/*") + %w(LICENSE README.textile)
s.files = Dir.glob("{rails,lib}/**/*") + %w(LICENSE README.md)

s.homepage = %q{http://github.com/lostboy/workless}
s.require_paths = ["lib"]
Expand Down

0 comments on commit 2550b0b

Please sign in to comment.