ComposableConnectionInterface.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. 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 a serialized command over the connection.
  26. *
  27. * @param string $buffer Serialized Redis command.
  28. */
  29. public function writeBytes($buffer);
  30. /**
  31. * Reads the given number of bytes from the connection.
  32. *
  33. * @param string
  34. */
  35. public function readBytes($length);
  36. /**
  37. * Reads a line from the connection.
  38. *
  39. * @param string
  40. */
  41. public function readLine();
  42. }