We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac2abae commit 846f840Copy full SHA for 846f840
src/Adapters/AmqpQueue.php
@@ -73,6 +73,10 @@ public function pop() : Event
73
$this->declareQueue();
74
$message = $this->amqpChannel->basic_get($this->queueName);
75
76
+ if (!empty($message)) {
77
+ $this->amqpChannel->basic_ack($message->delivery_info['delivery_tag']);
78
+ }
79
+
80
return ($message) ? $this->serializer->unserialize($message->body) : NullEvent::create();
81
}
82
@@ -85,10 +89,9 @@ public function hasElements(): bool
85
89
{
86
90
$hasElements = false;
87
91
88
- $event = $this->pop();
- if (false === $event instanceof NullEvent) {
92
+ $message = $this->amqpChannel->basic_get($this->queueName);
93
+ if ($message) {
94
$hasElements = true;
- $this->push($event);
95
96
97
return $hasElements;
0 commit comments