1 | <?php |
||
20 | class Sqs extends AbstractQueue |
||
21 | { |
||
22 | |||
23 | /** |
||
24 | * The SQS url. |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | public $url; |
||
29 | |||
30 | /** |
||
31 | * The config for SqsClient. |
||
32 | * |
||
33 | * This will be used for SqsClient::factory($config); |
||
34 | * @var array |
||
35 | */ |
||
36 | public $config = []; |
||
37 | |||
38 | /** |
||
39 | * Due to ability of the queue message to be visible automatically after |
||
40 | * a certain of time, this is not required. |
||
41 | * |
||
42 | * @inheritdoc |
||
43 | */ |
||
44 | public $releaseOnFailure = false; |
||
45 | |||
46 | /** |
||
47 | * Stores the SQS client. |
||
48 | * @var \Aws\Sqs\SqsClient |
||
49 | */ |
||
50 | private $client; |
||
51 | |||
52 | /** |
||
53 | * @inheritdoc |
||
54 | */ |
||
55 | public function init() |
||
60 | |||
61 | /** |
||
62 | * @inheritdoc |
||
63 | */ |
||
64 | public function fetchJob() |
||
77 | |||
78 | /** |
||
79 | * Create job from SQS message. |
||
80 | * |
||
81 | * @param array $message |
||
82 | * @return JobInterface |
||
83 | */ |
||
84 | private function createJobFromMessage($message) |
||
91 | |||
92 | /** |
||
93 | * @param JobInterface $job |
||
94 | * @param array $options |
||
95 | * @return array |
||
96 | */ |
||
97 | protected function mergePostOptions(JobInterface $job, array $options = []) |
||
105 | |||
106 | /** |
||
107 | * @inheritdoc |
||
108 | */ |
||
109 | protected function postJob(JobInterface $job, array $options = []): bool |
||
131 | |||
132 | /** |
||
133 | * @inheritdoc |
||
134 | */ |
||
135 | public function deleteJob(JobInterface $job): bool |
||
150 | |||
151 | /** |
||
152 | * @inheritdoc |
||
153 | */ |
||
154 | public function releaseJob(JobInterface $job): bool |
||
170 | |||
171 | /** |
||
172 | * Returns the SQS client used. |
||
173 | * |
||
174 | * @return \Aws\Sqs\SqsClient |
||
175 | */ |
||
176 | public function getClient() |
||
180 | |||
181 | /** |
||
182 | * @inheritdoc |
||
183 | */ |
||
184 | public function getSize(): int |
||
199 | |||
200 | /** |
||
201 | * @inheritdoc |
||
202 | */ |
||
203 | public function purge(): bool |
||
210 | } |
||
211 |