Sha256: d5ece4a09503b517f340a511a4d1b88313764c739070964bc05cfcd3bbdbc0e9
Contents?: true
Size: 816 Bytes
Versions: 13
Compression:
Stored size: 816 Bytes
Contents
module RedisFailover # Base class for strategies that determine which node is used during failover. class FailoverStrategy include Util # Loads a strategy based on the given name. # # @param [String, Symbol] name the strategy name # @return [Object] a new strategy instance def self.for(name) require "redis_failover/failover_strategy/#{name.downcase}" const_get(name.capitalize).new rescue LoadError, NameError raise "Failed to find failover strategy: #{name}" end # Returns a candidate node as determined by this strategy. # # @param [Hash<Node, NodeSnapshot>] snapshots the node snapshots # @return [Node] the candidate node or nil if one couldn't be found def find_candidate(snapshots) raise NotImplementedError end end end
Version data entries
13 entries across 13 versions & 3 rubygems