Module: Mongo::Cluster::Topology
- Extended by:
- Topology
- Included in:
- Topology
- Defined in:
- lib/mongo/cluster/topology.rb,
lib/mongo/cluster/topology/single.rb,
lib/mongo/cluster/topology/sharded.rb,
lib/mongo/cluster/topology/unknown.rb,
lib/mongo/cluster/topology/replica_set.rb
Overview
Defines behaviour for getting servers.
Defined Under Namespace
Classes: ReplicaSet, Sharded, Single, Unknown
Constant Summary collapse
- OPTIONS =
The 2 various topologies for server selection.
{ replica_set: ReplicaSet, sharded: Sharded, direct: Single }
Instance Method Summary collapse
-
#initial(seeds, options) ⇒ ReplicaSet, ...
Get the initial cluster topology for the provided options.
Instance Method Details
#initial(seeds, options) ⇒ ReplicaSet, ...
Get the initial cluster topology for the provided options.
49 50 51 52 53 54 55 56 57 |
# File 'lib/mongo/cluster/topology.rb', line 49 def initial(seeds, ) if .has_key?(:connect) OPTIONS.fetch([:connect]).new(, seeds) elsif .has_key?(:replica_set) ReplicaSet.new(, seeds) else Unknown.new(, seeds) end end |