Module: Redis::Cluster::SlotLoader

Defined in:
lib/redis/cluster/slot_loader.rb

Overview

Load and hashify slot info for Redis Cluster Client

Class Method Summary collapse

Class Method Details

.load(nodes) ⇒ Object

Raises:



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/redis/cluster/slot_loader.rb', line 12

def load(nodes)
  info = {}

  nodes.each do |node|
    info = fetch_slot_info(node)
    info.empty? ? next : break
  end

  return info unless info.empty?

  raise CannotConnectError, 'Redis client could not connect to any cluster nodes'
end