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 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 ComposableConnectionInterface extends SingleConnectionInterface
  20. {
  21. /**
  22. * Gets the protocol processor used by the connection.
  23. */
  24. public function getProtocol();
  25. /**
  26. * Writes a buffer that contains a serialized Redis command.
  27. *
  28. * @param string $buffer Serialized Redis command.
  29. */
  30. public function writeBytes($buffer);
  31. /**
  32. * Reads a specified number of bytes from the connection.
  33. *
  34. * @param string
  35. */
  36. public function readBytes($length);
  37. /**
  38. * Reads a line from the connection.
  39. *
  40. * @param string
  41. */
  42. public function readLine();
  43. }