ReplicationConnectionInterface.php 1.2 KB

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