CommandProcessorChainInterface.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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\Command\Processor;
  11. use IteratorAggregate;
  12. use Countable;
  13. /**
  14. * A command processor chain processes a command using multiple chained command
  15. * processor before it is sent to Redis.
  16. *
  17. * @author Daniele Alessandri <suppakilla@gmail.com>
  18. */
  19. interface CommandProcessorChainInterface
  20. extends CommandProcessorInterface, IteratorAggregate, Countable
  21. {
  22. /**
  23. * Adds the given command processor.
  24. *
  25. * @param CommandProcessorInterface $processor Command processor.
  26. */
  27. public function add(CommandProcessorInterface $processor);
  28. /**
  29. * Removes the given command processor from the chain if previously added.
  30. *
  31. * @param CommandProcessorInterface $processor Command processor.
  32. */
  33. public function remove(CommandProcessorInterface $processor);
  34. /**
  35. * Returns an ordered list of the command processors in the chain.
  36. *
  37. * @return array
  38. */
  39. public function getProcessors();
  40. }