ResponseHandlerInterface.php 896 B

123456789101112131415161718192021222324252627282930313233
  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\Protocol\Text\Handler;
  11. use Predis\Connection\CompositeConnectionInterface;
  12. /**
  13. * Defines a pluggable handler used to parse a particular type of response.
  14. *
  15. * @author Daniele Alessandri <suppakilla@gmail.com>
  16. */
  17. interface ResponseHandlerInterface
  18. {
  19. /**
  20. * Deserializes a response returned by Redis and reads more data from the
  21. * connection if needed.
  22. *
  23. * @param CompositeConnectionInterface $connection Redis connection.
  24. * @param string $payload String payload.
  25. *
  26. * @return mixed
  27. */
  28. public function handle(CompositeConnectionInterface $connection, $payload);
  29. }