Skip to content

Commit

Permalink
Merge pull request #254 from pablofmorales/Pablo/IntervalInPopMessage
Browse files Browse the repository at this point in the history
Use interval value instead of hard coded values
  • Loading branch information
henrikbjorn committed Oct 12, 2016
2 parents ec54820 + a9086c7 commit bdb69cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Driver/PhpAmqpDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ public function pushMessage($queueName, $message)
*
* @return array An array like array($message, $receipt);
*/
public function popMessage($queueName, $interval = 5)
public function popMessage($queueName, $interval = 10000)
{
$message = $this->getChannel()->basic_get($queueName);
if (!$message) {
// sleep for 10 ms to prevent hammering CPU
usleep(10000);
usleep($interval);

return [null, null];
}
Expand Down

0 comments on commit bdb69cb

Please sign in to comment.