Module: Resque::Plugins::HerokuAutoscaler::Config
Instance Attribute Summary collapse
- #heroku_app ⇒ Object
- #heroku_pass ⇒ Object
- #heroku_user ⇒ Object
-
#scaling_disabled ⇒ Object
writeonly
Sets the attribute scaling_disabled.
Instance Method Summary collapse
- #new_worker_count(pending = nil, *payload, &calculate_count) ⇒ Object
- #reset ⇒ Object
- #scaling_disabled? ⇒ Boolean
Instance Attribute Details
#heroku_app ⇒ Object
27 28 29 |
# File 'lib/resque/plugins/heroku_autoscaler/config.rb', line 27 def heroku_app @heroku_app || ENV['HEROKU_APP'] end |
#heroku_pass ⇒ Object
22 23 24 |
# File 'lib/resque/plugins/heroku_autoscaler/config.rb', line 22 def heroku_pass @heroku_pass || ENV['HEROKU_PASS'] end |
#heroku_user ⇒ Object
17 18 19 |
# File 'lib/resque/plugins/heroku_autoscaler/config.rb', line 17 def heroku_user @heroku_user || ENV['HEROKU_USER'] end |
#scaling_disabled=(value) ⇒ Object (writeonly)
Sets the attribute scaling_disabled
9 10 11 |
# File 'lib/resque/plugins/heroku_autoscaler/config.rb', line 9 def scaling_disabled=(value) @scaling_disabled = value end |
Instance Method Details
#new_worker_count(pending = nil, *payload, &calculate_count) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/resque/plugins/heroku_autoscaler/config.rb', line 31 def new_worker_count(pending=nil, *payload, &calculate_count) if calculate_count @new_worker_count = calculate_count else @new_worker_count.call(pending, *payload) end end |
#reset ⇒ Object
39 40 41 42 |
# File 'lib/resque/plugins/heroku_autoscaler/config.rb', line 39 def reset @scaling_disabled = false @new_worker_count = Proc.new {|pending| pending >0 ? 1 : 0} end |
#scaling_disabled? ⇒ Boolean
10 11 12 |
# File 'lib/resque/plugins/heroku_autoscaler/config.rb', line 10 def scaling_disabled? @scaling_disabled end |