IConnectionComposable.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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\Network;
  11. use Predis\Protocol\IProtocolProcessor;
  12. /**
  13. * Defines a connection object used to communicate with a single Redis server
  14. * that leverages an external protocol processor to handle pluggable protocol
  15. * handlers.
  16. *
  17. * @author Daniele Alessandri <suppakilla@gmail.com>
  18. */
  19. interface IConnectionComposable extends IConnectionSingle
  20. {
  21. /**
  22. * Sets the protocol processor used by the connection.
  23. *
  24. * @param IProtocolProcessor $protocol Protocol processor.
  25. */
  26. public function setProtocol(IProtocolProcessor $protocol);
  27. /**
  28. * Gets the protocol processor used by the connection.
  29. */
  30. public function getProtocol();
  31. /**
  32. * Writes a buffer that contains a serialized Redis command.
  33. *
  34. * @param string $buffer Serialized Redis command.
  35. */
  36. public function writeBytes($buffer);
  37. /**
  38. * Reads a specified number of bytes from the connection.
  39. *
  40. * @param string
  41. */
  42. public function readBytes($length);
  43. /**
  44. * Reads a line from the connection.
  45. *
  46. * @param string
  47. */
  48. public function readLine();
  49. }