SingleConnectionInterface.php 1.4 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 object used to communicate with a single Redis server.
  14. *
  15. * @author Daniele Alessandri <suppakilla@gmail.com>
  16. */
  17. interface SingleConnectionInterface 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 a Redis server.
  27. *
  28. * @return mixed
  29. */
  30. public function getResource();
  31. /**
  32. * Gets the parameters used to initialize the connection object.
  33. *
  34. * @return ConnectionParametersInterface
  35. */
  36. public function getParameters();
  37. /**
  38. * Pushes the instance of a Redis command to the queue of commands executed
  39. * when the actual connection to a server is estabilished.
  40. *
  41. * @param CommandInterface $command Instance of a Redis command.
  42. */
  43. public function pushInitCommand(CommandInterface $command);
  44. /**
  45. * Reads a reply from the server.
  46. *
  47. * @return mixed
  48. */
  49. public function read();
  50. }