class Redis::Cluster
def send_command(command, &block)
def send_command(command, &block) cmd = command.first.to_s.downcase case cmd when 'acl', 'auth', 'bgrewriteaof', 'bgsave', 'quit', 'save' @node.call_all(command, &block).first when 'flushall', 'flushdb' @node.call_master(command, &block).first when 'wait' then @node.call_master(command, &block).reduce(:+) when 'keys' then @node.call_slave(command, &block).flatten.sort when 'dbsize' then @node.call_slave(command, &block).reduce(:+) when 'lastsave' then @node.call_all(command, &block).sort when 'role' then @node.call_all(command, &block) when 'config' then send_config_command(command, &block) when 'client' then send_client_command(command, &block) when 'cluster' then send_cluster_command(command, &block) when 'readonly', 'readwrite', 'shutdown' raise OrchestrationCommandNotSupported, cmd when 'memory' then send_memory_command(command, &block) when 'script' then send_script_command(command, &block) when 'pubsub' then send_pubsub_command(command, &block) when 'discard', 'exec', 'multi', 'unwatch' raise AmbiguousNodeError, cmd else node = assign_node(command) try_send(node, :call, command, &block) end end