module Redis::Cluster::CommandLoader

Load details about Redis commands for Redis Cluster Client @see redis.io/commands/command

Public Instance Methods

fetch_command_details(node) click to toggle source
# File lib/redis/cluster/command_loader.rb, line 24
def fetch_command_details(node)
  node.call(%i[command]).map do |reply|
    [reply[0], { arity: reply[1], flags: reply[2], first: reply[3], last: reply[4], step: reply[5] }]
  end.to_h
end
load(nodes) click to toggle source
# File lib/redis/cluster/command_loader.rb, line 12
def load(nodes)
  errors = nodes.map do |node|
    begin
      return fetch_command_details(node)
    rescue CannotConnectError, ConnectionError, CommandError => error
      error
    end
  end

  raise InitialSetupError, errors
end