Class: BigBrother::ClusterFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/big_brother/cluster_factory.rb

Constant Summary collapse

ACTIVE_PASSIVE_CLUSTER =
'active_passive'
ACTIVE_ACTIVE_CLUSTER =
'active_active'
CLUSTERS =
{
  ACTIVE_PASSIVE_CLUSTER => ActivePassiveCluster,
  ACTIVE_ACTIVE_CLUSTER  => ActiveActiveCluster,
}

Class Method Summary collapse

Class Method Details

.create_cluster(name, attributes) ⇒ Object



12
13
14
# File 'lib/big_brother/cluster_factory.rb', line 12

def self.create_cluster(name, attributes)
  CLUSTERS.fetch(attributes[:backend_mode], BigBrother::Cluster).new(name, attributes)
end