mirror of
https://github.com/predis/predis.git
synced 2026-08-25 13:29:36 +00:00
abd284c972
* Renamed SingleConnectionInterface to NodeConnectionInterface since this name is better and makes even more sense in the context of cluster and replication scenarios. * Moved specialized aggregate connections (the ones implementing both predis and redis cluster and master/slave replication) in a newly created Predis\Connection\Aggregate sub-namespace. * Removed the "Connection" part from names of aggregate connection interfaces in the Predis\Connection\Aggregate sub-namespace. * Changed "Composable" to "Composite" in the name of interfaces and classes that can use pluggable protocol processors.
52 lines
1.3 KiB
PHP
52 lines
1.3 KiB
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of the Predis package.
|
|
*
|
|
* (c) Daniele Alessandri <suppakilla@gmail.com>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Predis\Connection\Aggregate;
|
|
|
|
use Predis\Connection\AggregateConnectionInterface;
|
|
|
|
/**
|
|
* Defines a group of Redis nodes in a master / slave replication setup.
|
|
*
|
|
* @author Daniele Alessandri <suppakilla@gmail.com>
|
|
*/
|
|
interface ReplicationInterface extends AggregateConnectionInterface
|
|
{
|
|
/**
|
|
* Switches the internal connection instance in use.
|
|
*
|
|
* @param string $connection Alias of a connection
|
|
*/
|
|
public function switchTo($connection);
|
|
|
|
/**
|
|
* Returns the connection instance currently in use by the aggregate
|
|
* connection.
|
|
*
|
|
* @return Predis\Connection\NodeConnectionInterface
|
|
*/
|
|
public function getCurrent();
|
|
|
|
/**
|
|
* Returns the connection instance for the master Redis node.
|
|
*
|
|
* @return Predis\Connection\NodeConnectionInterface
|
|
*/
|
|
public function getMaster();
|
|
|
|
/**
|
|
* Returns a list of connection instances to slave nodes.
|
|
*
|
|
* @return Predis\Connection\NodeConnectionInterface
|
|
*/
|
|
public function getSlaves();
|
|
}
|