Job.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?php
  2. namespace Illuminate\Contracts\Queue;
  3. interface Job
  4. {
  5. /**
  6. * Fire the job.
  7. *
  8. * @return void
  9. */
  10. public function fire();
  11. /**
  12. * Release the job back into the queue.
  13. *
  14. * @param int $delay
  15. * @return mixed
  16. */
  17. public function release($delay = 0);
  18. /**
  19. * Delete the job from the queue.
  20. *
  21. * @return void
  22. */
  23. public function delete();
  24. /**
  25. * Determine if the job has been deleted.
  26. *
  27. * @return bool
  28. */
  29. public function isDeleted();
  30. /**
  31. * Determine if the job has been deleted or released.
  32. *
  33. * @return bool
  34. */
  35. public function isDeletedOrReleased();
  36. /**
  37. * Get the number of times the job has been attempted.
  38. *
  39. * @return int
  40. */
  41. public function attempts();
  42. /**
  43. * Process an exception that caused the job to fail.
  44. *
  45. * @param \Throwable $e
  46. * @return void
  47. */
  48. public function failed($e);
  49. /**
  50. * Get the number of times to attempt a job.
  51. *
  52. * @return int|null
  53. */
  54. public function maxTries();
  55. /**
  56. * Get the number of seconds the job can run.
  57. *
  58. * @return int|null
  59. */
  60. public function timeout();
  61. /**
  62. * Get the timestamp indicating when the job should timeout.
  63. *
  64. * @return int|null
  65. */
  66. public function timeoutAt();
  67. /**
  68. * Get the name of the queued job class.
  69. *
  70. * @return string
  71. */
  72. public function getName();
  73. /**
  74. * Get the resolved name of the queued job class.
  75. *
  76. * Resolves the name of "wrapped" jobs such as class-based handlers.
  77. *
  78. * @return string
  79. */
  80. public function resolveName();
  81. /**
  82. * Get the name of the connection the job belongs to.
  83. *
  84. * @return string
  85. */
  86. public function getConnectionName();
  87. /**
  88. * Get the name of the queue the job belongs to.
  89. *
  90. * @return string
  91. */
  92. public function getQueue();
  93. /**
  94. * Get the raw body string for the job.
  95. *
  96. * @return string
  97. */
  98. public function getRawBody();
  99. }