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