README.textile in workless-0.0.3 vs README.textile in workless-0.0.4

- old
+ new

@@ -9,24 +9,49 @@ 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. h2. Installation -Add the gem to your Gemfile +Add the gem to your project Gemfile and update your bundle <pre> gem "workless" </pre> +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> +</pre> + +h2. 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 + +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: + +<pre> +Delayed::Job.scaler = :null +</pre> + +There are two other scalers included but generally these will be chosen for you based on if its running on Heroku + +<pre> +Delayed::Job.scaler = :heroku +Delayed::Job.scaler = :local +</pre> + +The local scaler uses @adamwiggins rush library http://github.com/adamwiggins/rush to start and stop workers on a local machine + h2. Note on Patches/Pull Requests -* Fork the project. +* 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. -* Add tests for it. This is important so I don't break it in a - future version unintentionally. * 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. Bonus points for topic branches. +* Send me a pull request. h2. Copyright Copyright (c) 2010 lostboy. See LICENSE for details.