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

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

Generates an updated slots map fetching the cluster configuration using the CLUSTER SLOTS command against the specified node or a random one from the pool.
public askSlotMap ( Predis\Connection\NodeConnectionInterface $connection = null )
$connection Predis\Connection\NodeConnectionInterface Optional connection instance.
    public function askSlotMap(NodeConnectionInterface $connection = null)
    {
        if (!$connection && !($connection = $this->getRandomConnection())) {
            return;
        }
        $this->slotmap->reset();
        $response = $this->queryClusterNodeForSlotMap($connection);
        foreach ($response as $slots) {
            // We only support master servers for now, so we ignore subsequent
            // elements in the $slots array identifying slaves.
            list($start, $end, $master) = $slots;
            if ($master[0] === '') {
                $this->slotmap->setSlots($start, $end, (string) $connection);
            } else {
                $this->slotmap->setSlots($start, $end, "{$master[0]}:{$master[1]}");
            }
        }
    }