Predis\Connection\Cluster\RedisCluster::getConnectionByCommand PHP Метод

getConnectionByCommand() публичный Метод

public getConnectionByCommand ( Predis\Command\CommandInterface $command )
$command Predis\Command\CommandInterface
    public function getConnectionByCommand(CommandInterface $command)
    {
        $slot = $this->strategy->getSlot($command);
        if (!isset($slot)) {
            throw new NotSupportedException("Cannot use '{$command->getId()}' with redis-cluster.");
        }
        if (isset($this->slots[$slot])) {
            return $this->slots[$slot];
        } else {
            return $this->getConnectionBySlot($slot);
        }
    }