BatchHandlerInterface.php 995 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.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 Symfony\Component\Messenger\Handler;
  11. /**
  12. * @author Nicolas Grekas <p@tchwork.com>
  13. */
  14. interface BatchHandlerInterface
  15. {
  16. /**
  17. * @param Acknowledger|null $ack The function to call to ack/nack the $message.
  18. * The message should be handled synchronously when null.
  19. *
  20. * @return mixed The number of pending messages in the batch if $ack is not null,
  21. * the result from handling the message otherwise
  22. */
  23. // public function __invoke(object $message, Acknowledger $ack = null): mixed;
  24. /**
  25. * Flushes any pending buffers.
  26. *
  27. * @param bool $force Whether flushing is required; it can be skipped if not
  28. */
  29. public function flush(bool $force): void;
  30. }