Make cluster and replication classes extend from a common interface.

This commit is contained in:
Daniele Alessandri
2012-02-07 11:42:34 +01:00
parent dc14c29676
commit b67af29eb6
10 changed files with 82 additions and 132 deletions
@@ -18,39 +18,8 @@ use Predis\Command\CommandInterface;
*
* @author Daniele Alessandri <suppakilla@gmail.com>
*/
interface ReplicationConnectionInterface extends ConnectionInterface
interface ReplicationConnectionInterface extends AggregatedConnectionInterface
{
/**
* Adds a connection instance to the cluster.
*
* @param SingleConnectionInterface $connection Instance of a connection.
*/
public function add(SingleConnectionInterface $connection);
/**
* Removes the specified connection instance from the cluster.
*
* @param SingleConnectionInterface $connection Instance of a connection.
* @return Boolean Returns true if the connection was in the pool.
*/
public function remove(SingleConnectionInterface $connection);
/**
* Gets the actual connection instance in charge of the specified command.
*
* @param CommandInterface $command Instance of a Redis command.
* @return SingleConnectionInterface
*/
public function getConnection(CommandInterface $command);
/**
* Retrieves a connection instance from the cluster using an alias.
*
* @param string $connectionId Alias of a connection
* @return SingleConnectionInterface
*/
public function getConnectionById($connectionId);
/**
* Switches the internal connection object being used.
*