Queue.php 2.3 KB

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