Skip to content

Commit

Permalink
Always operate in blocking mode
Browse files Browse the repository at this point in the history
Due to changes in php-amqplib/php-amqplib#642, non-blocking mode does not use a timeout, which results in an infinite loop and high CPU.

This change ensures that only blocking mode is used.

Fixes bschmitt#63
  • Loading branch information
lukebakken authored and stevenklar committed Aug 29, 2019
1 parent 5aa8146 commit 445a255
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Consumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ function ($message) use ($closure, $object) {

// consume
while (count($this->getChannel()->callbacks)) {
$this->getChannel()->wait(
null,
!$this->getProperty('blocking'),
$this->getChannel()->wait(null, false,
$this->getProperty('timeout') ? $this->getProperty('timeout') : 0
);
}
Expand Down

0 comments on commit 445a255

Please sign in to comment.