Skip to content

Commit e8de703

Browse files
committed
Updated as per @bastnic comment
1 parent 8f7b00b commit e8de703

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

RabbitMq/RpcClient.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public function addRequest($msgBody, $server, $requestId = null, $routingKey = '
3333

3434
public function getReplies()
3535
{
36+
$this->replies = array();
3637
$this->getChannel()->basic_consume($this->queueName, '', false, true, false, false, array($this, 'processMessage'));
3738

3839
while (count($this->replies) < $this->requests) {
@@ -41,10 +42,8 @@ public function getReplies()
4142

4243
$this->getChannel()->basic_cancel($this->queueName);
4344
$this->requests = 0;
44-
$replies = $this->replies;
45-
$this->replies = array();
4645

47-
return $replies;
46+
return $this->replies;
4847
}
4948

5049
public function processMessage(AMQPMessage $msg)

0 commit comments

Comments
 (0)