master

laravel/framework

Last updated at: 29/12/2023 09:21

Connector.php

TLDR

The Connector interface in the Illuminate\Contracts\Redis namespace provides two methods for creating connections to Redis clusters and instances.

Methods

connect

This method creates a connection to a Redis cluster.

  • Parameters:
    • $config (array): The configuration options for the connection.
    • $options (array): Additional options for the connection.
  • Returns: An instance of \Illuminate\Redis\Connections\Connection.

connectToCluster

This method creates a connection to a Redis instance.

  • Parameters:
    • $config (array): The configuration options for the connection.
    • $clusterOptions (array): Options for the Redis cluster.
    • $options (array): Additional options for the connection.
  • Returns: An instance of \Illuminate\Redis\Connections\Connection.
<?php

namespace Illuminate\Contracts\Redis;

interface Connector
{
    /**
     * Create a connection to a Redis cluster.
     *
     * @param  array  $config
     * @param  array  $options
     * @return \Illuminate\Redis\Connections\Connection
     */
    public function connect(array $config, array $options);

    /**
     * Create a connection to a Redis instance.
     *
     * @param  array  $config
     * @param  array  $clusterOptions
     * @param  array  $options
     * @return \Illuminate\Redis\Connections\Connection
     */
    public function connectToCluster(array $config, array $clusterOptions, array $options);
}