ReplicationConnectionInterface.php 1.2 KB

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