1<?php 2 3/* 4 * This file is part of the Predis package. 5 * 6 * (c) Daniele Alessandri <suppakilla@gmail.com> 7 * 8 * For the full copyright and license information, please view the LICENSE 9 * file that was distributed with this source code. 10 */ 11 12namespace Predis\Connection\Aggregate; 13 14use Predis\Connection\AggregateConnectionInterface; 15use Predis\Connection\NodeConnectionInterface; 16 17/** 18 * Defines a group of Redis nodes in a master / slave replication setup. 19 * 20 * @author Daniele Alessandri <suppakilla@gmail.com> 21 */ 22interface ReplicationInterface extends AggregateConnectionInterface 23{ 24 /** 25 * Switches the internal connection instance in use. 26 * 27 * @param string $connection Alias of a connection 28 */ 29 public function switchTo($connection); 30 31 /** 32 * Returns the connection instance currently in use by the aggregate 33 * connection. 34 * 35 * @return NodeConnectionInterface 36 */ 37 public function getCurrent(); 38 39 /** 40 * Returns the connection instance for the master Redis node. 41 * 42 * @return NodeConnectionInterface 43 */ 44 public function getMaster(); 45 46 /** 47 * Returns a list of connection instances to slave nodes. 48 * 49 * @return NodeConnectionInterface 50 */ 51 public function getSlaves(); 52} 53