Predis\Client::createAggregateConnection PHP Method

createAggregateConnection() protected method

Creates an aggregate connection.
protected createAggregateConnection ( mixed $parameters, string $option ) : Closure
$parameters mixed Connection parameters.
$option string Option for aggregate connections (`aggregate`, `cluster`, `replication`).
return Closure
    protected function createAggregateConnection($parameters, $option)
    {
        $options = $this->getOptions();
        $initializer = $options->{$option};
        $connection = $initializer($parameters);
        // TODO: this is dirty but we must skip the redis-sentinel backend for now.
        if ($option !== 'aggregate' && !$connection instanceof SentinelReplication) {
            $options->connections->aggregate($connection, $parameters);
        }
        return $connection;
    }