RetryStrategyInterface.php 949 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\Retry;
  11. use Symfony\Component\Messenger\Envelope;
  12. /**
  13. * @author Fabien Potencier <fabien@symfony.com>
  14. * @author Grégoire Pineau <lyrixx@lyrixx.info>
  15. * @author Ryan Weaver <ryan@symfonycasts.com>
  16. */
  17. interface RetryStrategyInterface
  18. {
  19. /**
  20. * @param \Throwable|null $throwable The cause of the failed handling
  21. */
  22. public function isRetryable(Envelope $message/*, \Throwable $throwable = null*/): bool;
  23. /**
  24. * @param \Throwable|null $throwable The cause of the failed handling
  25. *
  26. * @return int The time to delay/wait in milliseconds
  27. */
  28. public function getWaitingTime(Envelope $message/*, \Throwable $throwable = null*/): int;
  29. }