ReplicationInterface.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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\Aggregate;
  11. use Predis\Connection\AggregateConnectionInterface;
  12. /**
  13. * Defines a group of Redis nodes in a master / slave replication setup.
  14. *
  15. * @author Daniele Alessandri <suppakilla@gmail.com>
  16. */
  17. interface ReplicationInterface extends AggregateConnectionInterface
  18. {
  19. /**
  20. * Switches the internal connection instance in use.
  21. *
  22. * @param string $connection Alias of a connection
  23. */
  24. public function switchTo($connection);
  25. /**
  26. * Returns the connection instance currently in use by the aggregate
  27. * connection.
  28. *
  29. * @return Predis\Connection\NodeConnectionInterface
  30. */
  31. public function getCurrent();
  32. /**
  33. * Returns the connection instance for the master Redis node.
  34. *
  35. * @return Predis\Connection\NodeConnectionInterface
  36. */
  37. public function getMaster();
  38. /**
  39. * Returns a list of connection instances to slave nodes.
  40. *
  41. * @return Predis\Connection\NodeConnectionInterface
  42. */
  43. public function getSlaves();
  44. }