README.md in heroku-resque-workers-scaler-0.2.0 vs README.md in heroku-resque-workers-scaler-0.2.1

- old
+ new

@@ -13,23 +13,49 @@ * I've switched Jeweler Gem generator to simpel Bundler gem generator * I've switched to Rspec from TestUnit * I've switched to HerokuAPI Gem instead of Heroku Client Gem * Add safe mode for heroku +* See CHANGELOG ### Configuration : You need to defined two vars for your heroku : -Go to your https://api.heroku.com/account +`Go to your https://api.heroku.com/account` + +``` heroku config:add HEROKU_API_KEY=your_api_key -a your_app_name heroku config:add HEROKU_APP_NAME=your_app_name -a your_app_name +heroku config:add export SAFE_MODE=true -a your_app_name +``` +## Run localy + You can test when executed this : + ``` - HEROKU_API_KEY=your_api_key HEROKU_APP_NAME=your_app_name *** bundle exec *** rake spec +export HEROKU_API_KEY=your_api_key +export HEROKU_APP_NAME=your_app_name +export SAFE_MODE=true +export ENVIRONMENT=development ``` +open `irb` + +``` +irb -r heroku-resque-workers-scaler -I ./lib +``` +play with commands +``` +>> HerokuResqueAutoScale::Scaler.workers +=> 0 +>> HerokuResqueAutoScale::Scaler.workers=1 +=> 1 +>> HerokuResqueAutoScale::Scaler.workers=0 +=> 0 +``` + You can change the thresholds, environments of execution and the name of your worker process in your project on config/scaler_config.yml Exmple YAML file contents: thresholds: @@ -38,11 +64,11 @@ - :workers: 2 :job_count: 15 environments: - production worker_name: resque - + I just bundled it into a gem for easy inclusion into other projects. #### Usage Once the gem is installed, simply extend your job class as follows: @@ -73,6 +99,5 @@ == Copyright Copyright (c) 2010 Mark Quezada. See LICENSE.txt for further details. -