IConnectionSingle.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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\Commands\ICommand;
  12. /**
  13. * Defines a connection object used to communicate with a single Redis server.
  14. *
  15. * @author Daniele Alessandri <suppakilla@gmail.com>
  16. */
  17. interface IConnectionSingle extends IConnection
  18. {
  19. /**
  20. * Returns a string representation of the connection.
  21. *
  22. * @return string
  23. */
  24. public function __toString();
  25. /**
  26. * Returns the underlying resource used to communicate with a Redis server.
  27. *
  28. * @return mixed
  29. */
  30. public function getResource();
  31. /**
  32. * Gets the parameters used to initialize the connection object.
  33. *
  34. * @return IConnectionParameters
  35. */
  36. public function getParameters();
  37. /**
  38. * Pushes the instance of a Redis command to the queue of commands executed
  39. * when the actual connection to a server is estabilished.
  40. *
  41. * @param ICommand $command Instance of a Redis command.
  42. * @return IConnectionParameters
  43. */
  44. public function pushInitCommand(ICommand $command);
  45. /**
  46. * Reads a reply from the server.
  47. *
  48. * @return mixed
  49. */
  50. public function read();
  51. }