Class: HireFire::Configuration
- Inherits:
-
Object
- Object
- HireFire::Configuration
- Defined in:
- lib/hirefire/configuration.rb
Instance Attribute Summary collapse
-
#environment ⇒ Symbol?
Default is nil, in which case it’ll auto-detect either :heroku or :noop, depending on the environment.
-
#job_worker_ratio ⇒ Array
Contains the job/worker ratio which determines how many workers need to be running depending on the amount of pending jobs.
-
#max_workers ⇒ Fixnum
Contains the max amount of workers that are allowed to run concurrently.
-
#min_workers ⇒ Fixnum
Contains the min amount of workers that should always be running.
Instance Method Summary collapse
-
#initialize ⇒ HireFire::Configuration
constructor
Instantiates a new HireFire::Configuration object with the default configuration.
Constructor Details
#initialize ⇒ HireFire::Configuration
Instantiates a new HireFire::Configuration object with the default configuration. These default configurations may be overwritten using the HireFire.configure class method
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/hirefire/configuration.rb', line 40 def initialize @max_workers = 1 @min_workers = 0 @job_worker_ratio = [ { :jobs => 1, :workers => 1 }, { :jobs => 25, :workers => 2 }, { :jobs => 50, :workers => 3 }, { :jobs => 75, :workers => 4 }, { :jobs => 100, :workers => 5 } ] end |
Instance Attribute Details
#environment ⇒ Symbol?
Default is nil, in which case it’ll auto-detect either :heroku or :noop, depending on the environment. It will never use :local, unless explicitly defined by the user.
32 33 34 |
# File 'lib/hirefire/configuration.rb', line 32 def environment @environment end |
#job_worker_ratio ⇒ Array
Contains the job/worker ratio which determines how many workers need to be running depending on the amount of pending jobs
24 25 26 |
# File 'lib/hirefire/configuration.rb', line 24 def job_worker_ratio @job_worker_ratio end |
#max_workers ⇒ Fixnum
Contains the max amount of workers that are allowed to run concurrently
10 11 12 |
# File 'lib/hirefire/configuration.rb', line 10 def max_workers @max_workers end |
#min_workers ⇒ Fixnum
Contains the min amount of workers that should always be running
16 17 18 |
# File 'lib/hirefire/configuration.rb', line 16 def min_workers @min_workers end |