Class: Gru::Configuration
- Inherits:
-
Object
- Object
- Gru::Configuration
- Defined in:
- lib/gru/configuration.rb
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
-
#client_settings ⇒ Object
readonly
Returns the value of attribute client_settings.
-
#cluster_maximums ⇒ Object
readonly
Returns the value of attribute cluster_maximums.
-
#cluster_name ⇒ Object
readonly
Returns the value of attribute cluster_name.
-
#environment_name ⇒ Object
readonly
Returns the value of attribute environment_name.
-
#host_maximums ⇒ Object
readonly
Returns the value of attribute host_maximums.
-
#manage_worker_heartbeats ⇒ Object
readonly
Returns the value of attribute manage_worker_heartbeats.
-
#max_worker_processes_per_host ⇒ Object
readonly
Returns the value of attribute max_worker_processes_per_host.
-
#presume_host_dead_after ⇒ Object
readonly
Returns the value of attribute presume_host_dead_after.
-
#rebalance_flag ⇒ Object
readonly
Returns the value of attribute rebalance_flag.
Instance Method Summary collapse
-
#initialize(settings) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(settings) ⇒ Configuration
Returns a new instance of Configuration.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/gru/configuration.rb', line 8 def initialize(settings) @host_maximums = settings.delete(:host_maximums) || settings.delete(:cluster_maximums) @cluster_maximums = settings.delete(:cluster_maximums) || @host_maximums @rebalance_flag = settings.delete(:rebalance_flag) || false @cluster_name = settings.delete(:cluster_name) || 'default' @environment_name = settings.delete(:environment_name) || 'default' @presume_host_dead_after = settings.delete(:presume_host_dead_after) @client_settings = settings.delete(:client_settings) @manage_worker_heartbeats = settings.delete(:manage_worker_heartbeats) || false @max_worker_processes_per_host = settings.delete(:max_workers_per_host) || 30 @adapter = Gru::Adapters::RedisAdapter.new(self) if @cluster_maximums.nil? raise ArgumentError, "Need at least a cluster configuration" end end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
6 7 8 |
# File 'lib/gru/configuration.rb', line 6 def adapter @adapter end |
#client_settings ⇒ Object (readonly)
Returns the value of attribute client_settings.
6 7 8 |
# File 'lib/gru/configuration.rb', line 6 def client_settings @client_settings end |
#cluster_maximums ⇒ Object (readonly)
Returns the value of attribute cluster_maximums.
6 7 8 |
# File 'lib/gru/configuration.rb', line 6 def cluster_maximums @cluster_maximums end |
#cluster_name ⇒ Object (readonly)
Returns the value of attribute cluster_name.
6 7 8 |
# File 'lib/gru/configuration.rb', line 6 def cluster_name @cluster_name end |
#environment_name ⇒ Object (readonly)
Returns the value of attribute environment_name.
6 7 8 |
# File 'lib/gru/configuration.rb', line 6 def environment_name @environment_name end |
#host_maximums ⇒ Object (readonly)
Returns the value of attribute host_maximums.
6 7 8 |
# File 'lib/gru/configuration.rb', line 6 def host_maximums @host_maximums end |
#manage_worker_heartbeats ⇒ Object (readonly)
Returns the value of attribute manage_worker_heartbeats.
6 7 8 |
# File 'lib/gru/configuration.rb', line 6 def manage_worker_heartbeats @manage_worker_heartbeats end |
#max_worker_processes_per_host ⇒ Object (readonly)
Returns the value of attribute max_worker_processes_per_host.
6 7 8 |
# File 'lib/gru/configuration.rb', line 6 def max_worker_processes_per_host @max_worker_processes_per_host end |
#presume_host_dead_after ⇒ Object (readonly)
Returns the value of attribute presume_host_dead_after.
6 7 8 |
# File 'lib/gru/configuration.rb', line 6 def presume_host_dead_after @presume_host_dead_after end |
#rebalance_flag ⇒ Object (readonly)
Returns the value of attribute rebalance_flag.
6 7 8 |
# File 'lib/gru/configuration.rb', line 6 def rebalance_flag @rebalance_flag end |