lib/mongo/cluster/topology.rb in mongo-2.4.0.rc1 vs lib/mongo/cluster/topology.rb in mongo-2.4.0
- old
+ new
@@ -24,36 +24,37 @@
#
# @since 2.0.0
module Topology
extend self
- # The 2 various topologies for server selection.
+ # The various topologies for server selection.
#
# @since 2.0.0
OPTIONS = {
replica_set: ReplicaSet,
sharded: Sharded,
direct: Single
- }
+ }.freeze
# Get the initial cluster topology for the provided options.
#
# @example Get the initial cluster topology.
# Topology.initial(topology: :replica_set)
#
# @param [ Array<String> ] seeds The addresses of the configured servers.
+ # @param [ Monitoring ] monitoring The monitoring.
# @param [ Hash ] options The cluster options.
#
# @return [ ReplicaSet, Sharded, Single ] The topology.
#
# @since 2.0.0
- def initial(seeds, options)
+ def initial(seeds, monitoring, options)
if options.has_key?(:connect)
- OPTIONS.fetch(options[:connect]).new(options, seeds)
+ OPTIONS.fetch(options[:connect]).new(options, monitoring, seeds)
elsif options.has_key?(:replica_set)
- ReplicaSet.new(options, seeds)
+ ReplicaSet.new(options, monitoring, options)
else
- Unknown.new(options, seeds)
+ Unknown.new(options, monitoring, seeds)
end
end
end
end
end