ReplicationConnectionInterface.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 servers in a master/slave replication configuration.
  13. *
  14. * @author Daniele Alessandri <suppakilla@gmail.com>
  15. */
  16. interface ReplicationConnectionInterface extends AggregatedConnectionInterface
  17. {
  18. /**
  19. * Switches the internal connection object being used.
  20. *
  21. * @param string $connection Alias of a connection
  22. */
  23. public function switchTo($connection);
  24. /**
  25. * Retrieves the connection object currently being used.
  26. *
  27. * @return SingleConnectionInterface
  28. */
  29. public function getCurrent();
  30. /**
  31. * Retrieves the connection object to the master Redis server.
  32. *
  33. * @return SingleConnectionInterface
  34. */
  35. public function getMaster();
  36. /**
  37. * Retrieves a list of connection objects to slaves Redis servers.
  38. *
  39. * @return SingleConnectionInterface
  40. */
  41. public function getSlaves();
  42. }