ComposableConnectionInterface.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\Protocol\ProtocolInterface;
  12. /**
  13. * Defines a connection to communicate with a single Redis server that leverages
  14. * an external protocol processor to handle pluggable protocol handlers.
  15. *
  16. * @author Daniele Alessandri <suppakilla@gmail.com>
  17. */
  18. interface ComposableConnectionInterface extends SingleConnectionInterface
  19. {
  20. /**
  21. * Returns the protocol processor used by the connection.
  22. */
  23. public function getProtocol();
  24. /**
  25. * Writes the buffer containing over the connection.
  26. *
  27. * @param string $buffer String buffer to be sent over the connection.
  28. */
  29. public function writeBuffer($buffer);
  30. /**
  31. * Reads the given number of bytes from the connection.
  32. *
  33. * @param int $length Number of bytes to read from the connection.
  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. }