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 various topologies for server selection.
{ replica_set: ReplicaSet, sharded: Sharded, direct: Single }.freeze
Instance Method Summary collapse
-
#initial(seeds, monitoring, options) ⇒ ReplicaSet, ...
Get the initial cluster topology for the provided options.
Instance Method Details
#initial(seeds, monitoring, options) ⇒ ReplicaSet, ...
Get the initial cluster topology for the provided options.
50 51 52 53 54 55 56 57 58 |
# File 'lib/mongo/cluster/topology.rb', line 50 def initial(seeds, monitoring, ) if .has_key?(:connect) OPTIONS.fetch([:connect].to_sym).new(, monitoring, seeds) elsif .has_key?(:replica_set) ReplicaSet.new(, monitoring, ) else Unknown.new(, monitoring, seeds) end end |