Skip to content

Commit 15d7c9c

Browse files
committed
SQS driver methods refactoring
1 parent 28b045b commit 15d7c9c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/drivers/sqs/Queue.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function run($repeat, $timeout = 0)
9393
$ttr = (int) $payload['MessageAttributes']['TTR']['StringValue'];
9494
$attempt = (int) $payload['Attributes']['ApproximateReceiveCount'];
9595
if ($this->handleMessage($id, $message, $ttr, $attempt)) {
96-
$this->release($payload);
96+
$this->delete($payload);
9797
}
9898
} elseif (!$repeat) {
9999
break;
@@ -108,7 +108,7 @@ public function run($repeat, $timeout = 0)
108108
* @param int $timeout number of seconds for long polling. Must be between 0 and 20.
109109
* @return null|array payload.
110110
*/
111-
public function reserve($timeout)
111+
protected function reserve($timeout)
112112
{
113113
$response = $this->getClient()->receiveMessage([
114114
'QueueUrl' => $this->url,
@@ -137,11 +137,11 @@ public function reserve($timeout)
137137
}
138138

139139
/**
140-
* Mark the message as handled.
140+
* Deletes the message after successfully handling.
141141
*
142142
* @param array $payload
143143
*/
144-
private function release($payload)
144+
protected function delete($payload)
145145
{
146146
$this->getClient()->deleteMessage([
147147
'QueueUrl' => $this->url,

0 commit comments

Comments
 (0)