1 | <?php |
||
15 | class SqsDriver extends AbstractPersistanceDriver |
||
16 | { |
||
17 | /** |
||
18 | * @var SqsClient |
||
19 | */ |
||
20 | private $client; |
||
21 | |||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | private $queueUrls; |
||
26 | |||
27 | /** |
||
28 | * @param SqsClient $client |
||
29 | * @param Serializer $serializer |
||
30 | * @param array $queueUrls |
||
31 | 11 | */ |
|
32 | public function __construct(SqsClient $client, Serializer $serializer, array $queueUrls = []) |
||
38 | |||
39 | /** |
||
40 | * {@inheritdoc} |
||
41 | 1 | */ |
|
42 | public static function allowedClasses() |
||
48 | 1 | ||
49 | 1 | /** |
|
50 | 1 | * @inheritDoc |
|
51 | */ |
||
52 | public function enqueue(string $queueName, Message $message): Envelope |
||
66 | |||
67 | /** |
||
68 | * @inheritDoc |
||
69 | 2 | */ |
|
70 | 1 | public function dequeue(string $queueName) |
|
93 | |||
94 | /** |
||
95 | * @inheritDoc |
||
96 | */ |
||
97 | 2 | public function ack(string $queueName, Envelope $envelope) |
|
115 | |||
116 | 1 | /** |
|
117 | * @inheritDoc |
||
118 | 1 | */ |
|
119 | public function retry(string $queueName, Envelope $envelope) : Envelope |
||
123 | |||
124 | /** |
||
125 | * @inheritDoc |
||
126 | 8 | */ |
|
127 | public function fail(string $queueName, Envelope $envelope) |
||
131 | |||
132 | 2 | /** |
|
133 | * Returns queue url |
||
134 | 2 | * |
|
135 | 1 | * @param string $queueName The name of the queue |
|
136 | * |
||
137 | * @return string The queue url |
||
138 | 1 | */ |
|
139 | public function getQueueUrl($queueName) |
||
153 | |||
154 | /** |
||
155 | * Release a message back to a ready state. This is used by the consumer |
||
156 | * when it skips the retry system. This may happen if the consumer receives |
||
157 | * a signal and has to exit early. |
||
158 | * |
||
159 | * @param $queueName The queue from which the message came |
||
160 | * @param $envelope The message to release, should be the same instance |
||
161 | * returned from `dequeue` |
||
162 | * |
||
163 | * @throws Exception\DriverError if something goes wrong |
||
164 | * @return void |
||
165 | */ |
||
166 | public function release(string $queueName, Envelope $envelope) |
||
170 | } |
||
171 |