Sha256: e71bb5a4f4eab398157615136ac6feee49bcf9e45316b6df1534b8a7efbd6436
Contents?: true
Size: 627 Bytes
Versions: 13
Compression:
Stored size: 627 Bytes
Contents
module RedisFailover class FailoverStrategy # Failover strategy that selects an available node that is both seen by all # node managers and has the lowest reported health check latency. class Latency < FailoverStrategy # @see RedisFailover::FailoverStrategy#find_candidate def find_candidate(snapshots) candidates = {} snapshots.each do |node, snapshot| if snapshot.all_available? candidates[node] = snapshot.avg_latency end end if candidate = candidates.min_by(&:last) candidate.first end end end end end
Version data entries
13 entries across 13 versions & 3 rubygems