ComposableConnectionInterface.php 1.2 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 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 ComposableConnectionInterface extends SingleConnectionInterface
  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. * @return string
  34. */
  35. public function readBuffer($length);
  36. /**
  37. * Reads a line from the connection.
  38. *
  39. * @param string
  40. */
  41. public function readLine();
  42. }