Module: Resque::Plugins::HerokuAutoscaler::Config

Extended by:
Config
Included in:
Config
Defined in:
lib/resque/plugins/heroku_autoscaler/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#heroku_appObject



27
28
29
# File 'lib/resque/plugins/heroku_autoscaler/config.rb', line 27

def heroku_app
  @heroku_app || ENV['HEROKU_APP']
end

#heroku_passObject



22
23
24
# File 'lib/resque/plugins/heroku_autoscaler/config.rb', line 22

def heroku_pass
  @heroku_pass || ENV['HEROKU_PASS']
end

#heroku_userObject



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

Parameters:

  • value

    the value to set the attribute scaling_disabled to.



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

#resetObject



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

Returns:

  • (Boolean)


10
11
12
# File 'lib/resque/plugins/heroku_autoscaler/config.rb', line 10

def scaling_disabled?
  @scaling_disabled
end