1 | <?php |
||
15 | abstract class Queue implements QueueInterface |
||
16 | { |
||
17 | use InteractWithTimeTrait; |
||
18 | |||
19 | /** |
||
20 | * The connection name for the queue. |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $connectionName; |
||
25 | |||
26 | /** |
||
27 | * Push a new job onto the queue. |
||
28 | * |
||
29 | * @param string $queue |
||
30 | * @param string $job |
||
31 | * @param array $data |
||
32 | * |
||
33 | * @return mixed |
||
34 | */ |
||
35 | public function pushOn(string $queue, string $job, array $data = []) |
||
39 | |||
40 | /** |
||
41 | * Push a new job onto the queue after a delay. |
||
42 | * |
||
43 | * @param string $queue |
||
44 | * @param \DateTimeInterface|\DateInterval|int $delay |
||
45 | * @param string $job |
||
46 | * @param array $data |
||
47 | * |
||
48 | * @return mixed |
||
49 | */ |
||
50 | public function laterOn(string $queue, $delay, string $job, array $data = []) |
||
54 | |||
55 | /** |
||
56 | * Push an array of jobs onto the queue. |
||
57 | * |
||
58 | * @param array $jobs |
||
59 | * @param array $data |
||
60 | * @param string $queue |
||
61 | * |
||
62 | * @return mixed |
||
63 | */ |
||
64 | public function bulk(array $jobs, array $data = [], ?string $queue = null) |
||
70 | |||
71 | /** |
||
72 | * Create a payload string from the given job and data. |
||
73 | * |
||
74 | * @param string $job |
||
75 | * @param mixed $data |
||
76 | * |
||
77 | * @return string |
||
78 | * |
||
79 | * @throws InvalidPayloadException |
||
80 | */ |
||
81 | protected function createPayload(string $job, array $data = []) |
||
93 | |||
94 | /** |
||
95 | * Create a payload array from the given job and data. |
||
96 | * |
||
97 | * @param string $job |
||
98 | * @param array $data |
||
99 | * |
||
100 | * @return array |
||
101 | */ |
||
102 | protected function createPayloadArray(string $job, array $data = []): array |
||
112 | |||
113 | /** |
||
114 | * Get the connection name for the queue. |
||
115 | * |
||
116 | * @return string |
||
117 | */ |
||
118 | public function getConnectionName(): string |
||
122 | |||
123 | /** |
||
124 | * Set the connection name for the queue. |
||
125 | * |
||
126 | * @param string $name |
||
127 | * |
||
128 | * @return $this |
||
129 | */ |
||
130 | public function setConnectionName(string $name) |
||
136 | } |
||
137 |