Queue.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?php
  2. namespace Illuminate\Contracts\Queue;
  3. /**
  4. * @method int pendingSize(string|null $queue = null)
  5. * @method int delayedSize(string|null $queue = null)
  6. * @method int reservedSize(string|null $queue = null)
  7. * @method int|null creationTimeOfOldestPendingJob(string|null $queue = null)
  8. */
  9. interface Queue
  10. {
  11. /**
  12. * Get the size of the queue.
  13. *
  14. * @param string|null $queue
  15. * @return int
  16. */
  17. public function size($queue = null);
  18. /**
  19. * Push a new job onto the queue.
  20. *
  21. * @param string|object $job
  22. * @param mixed $data
  23. * @param string|null $queue
  24. * @return mixed
  25. */
  26. public function push($job, $data = '', $queue = null);
  27. /**
  28. * Push a new job onto the queue.
  29. *
  30. * @param string $queue
  31. * @param string|object $job
  32. * @param mixed $data
  33. * @return mixed
  34. */
  35. public function pushOn($queue, $job, $data = '');
  36. /**
  37. * Push a raw payload onto the queue.
  38. *
  39. * @param string $payload
  40. * @param string|null $queue
  41. * @return mixed
  42. */
  43. public function pushRaw($payload, $queue = null, array $options = []);
  44. /**
  45. * Push a new job onto the queue after (n) seconds.
  46. *
  47. * @param \DateTimeInterface|\DateInterval|int $delay
  48. * @param string|object $job
  49. * @param mixed $data
  50. * @param string|null $queue
  51. * @return mixed
  52. */
  53. public function later($delay, $job, $data = '', $queue = null);
  54. /**
  55. * Push a new job onto a specific queue after (n) seconds.
  56. *
  57. * @param string $queue
  58. * @param \DateTimeInterface|\DateInterval|int $delay
  59. * @param string|object $job
  60. * @param mixed $data
  61. * @return mixed
  62. */
  63. public function laterOn($queue, $delay, $job, $data = '');
  64. /**
  65. * Push an array of jobs onto the queue.
  66. *
  67. * @param array $jobs
  68. * @param mixed $data
  69. * @param string|null $queue
  70. * @return mixed
  71. */
  72. public function bulk($jobs, $data = '', $queue = null);
  73. /**
  74. * Pop the next job off of the queue.
  75. *
  76. * @param string|null $queue
  77. * @return \Illuminate\Contracts\Queue\Job|null
  78. */
  79. public function pop($queue = null);
  80. /**
  81. * Get the connection name for the queue.
  82. *
  83. * @return string
  84. */
  85. public function getConnectionName();
  86. /**
  87. * Set the connection name for the queue.
  88. *
  89. * @param string $name
  90. * @return $this
  91. */
  92. public function setConnectionName($name);
  93. }