NodeConnectionInterface.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 connection used to communicate with a single Redis node.
  14. *
  15. * @author Daniele Alessandri <suppakilla@gmail.com>
  16. */
  17. interface NodeConnectionInterface extends ConnectionInterface
  18. {
  19. /**
  20. * Returns a string representation of the connection.
  21. *
  22. * @return string
  23. */
  24. public function __toString();
  25. /**
  26. * Returns the underlying resource used to communicate with Redis.
  27. *
  28. * @return mixed
  29. */
  30. public function getResource();
  31. /**
  32. * Returns the parameters used to initialize the connection.
  33. *
  34. * @return ParametersInterface
  35. */
  36. public function getParameters();
  37. /**
  38. * Pushes the given command into a queue of commands executed when
  39. * establishing the actual connection to Redis.
  40. *
  41. * @param CommandInterface $command Instance of a Redis command.
  42. */
  43. public function addConnectCommand(CommandInterface $command);
  44. /**
  45. * Reads a response from the server.
  46. *
  47. * @return mixed
  48. */
  49. public function read();
  50. }