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);
}
}