FireAndForgetExecutor.php 843 B

12345678910111213141516171819202122232425262728293031323334353637
  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\Pipeline;
  11. use Predis\Network\IConnection;
  12. /**
  13. * Implements a pipeline executor strategy that writes a list of commands to
  14. * the connection object but does not read back their replies.
  15. *
  16. * @author Daniele Alessandri <suppakilla@gmail.com>
  17. */
  18. class FireAndForgetExecutor implements IPipelineExecutor
  19. {
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function execute(IConnection $connection, &$commands)
  24. {
  25. foreach ($commands as $command) {
  26. $connection->writeCommand($command);
  27. }
  28. $connection->disconnect();
  29. return array();
  30. }
  31. }