CompositeConnectionInterface.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 connection to communicate with a single Redis server that leverages
  13. * an external protocol processor to handle pluggable protocol handlers.
  14. *
  15. * @author Daniele Alessandri <suppakilla@gmail.com>
  16. */
  17. interface CompositeConnectionInterface extends NodeConnectionInterface
  18. {
  19. /**
  20. * Returns the protocol processor used by the connection.
  21. */
  22. public function getProtocol();
  23. /**
  24. * Writes the buffer containing over the connection.
  25. *
  26. * @param string $buffer String buffer to be sent over the connection.
  27. */
  28. public function writeBuffer($buffer);
  29. /**
  30. * Reads the given number of bytes from the connection.
  31. *
  32. * @param int $length Number of bytes to read from the connection.
  33. *
  34. * @return string
  35. */
  36. public function readBuffer($length);
  37. /**
  38. * Reads a line from the connection.
  39. *
  40. * @param string
  41. */
  42. public function readLine();
  43. }