Module: SolidCache::Store::Clusters
- Included in:
- SolidCache::Store
- Defined in:
- lib/solid_cache/store/clusters.rb
Instance Attribute Summary collapse
-
#clusters ⇒ Object
readonly
Returns the value of attribute clusters.
-
#primary_cluster ⇒ Object
readonly
Returns the value of attribute primary_cluster.
Instance Method Summary collapse
Instance Attribute Details
#clusters ⇒ Object (readonly)
Returns the value of attribute clusters.
6 7 8 |
# File 'lib/solid_cache/store/clusters.rb', line 6 def clusters @clusters end |
#primary_cluster ⇒ Object (readonly)
Returns the value of attribute primary_cluster.
6 7 8 |
# File 'lib/solid_cache/store/clusters.rb', line 6 def primary_cluster @primary_cluster end |
Instance Method Details
#initialize(options = {}) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/solid_cache/store/clusters.rb', line 8 def initialize( = {}) super() = .fetch(:clusters) { [ .fetch(:cluster, {}) ] } @clusters = .map.with_index do |, index| Cluster.new(.merge().merge(async_writes: index != 0, error_handler: error_handler)) end @primary_cluster = clusters.first end |
#setup! ⇒ Object
20 21 22 |
# File 'lib/solid_cache/store/clusters.rb', line 20 def setup! clusters.each(&:setup!) end |