RetryableJobInterface.php 603 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * @link http://www.yiiframework.com/
  4. * @copyright Copyright (c) 2008 Yii Software LLC
  5. * @license http://www.yiiframework.com/license/
  6. */
  7. namespace yii\queue;
  8. /**
  9. * Retryable Job Interface.
  10. *
  11. * @author Roman Zhuravlev <zhuravljov@gmail.com>
  12. */
  13. interface RetryableJobInterface extends JobInterface
  14. {
  15. /**
  16. * @return int time to reserve in seconds
  17. */
  18. public function getTtr();
  19. /**
  20. * @param int $attempt number
  21. * @param \Exception|\Throwable $error from last execute of the job
  22. * @return bool
  23. */
  24. public function canRetry($attempt, $error);
  25. }