Closed umbrella-artem-seryak closed 5 years ago
Just to piggyback on that, the blocking
config option isn't really documented anywhere at all that I could see, but, given the latest changes, it's SUPER important for queue consumers.
@umbrella-artem-seryak do you see this as a issue of this library? Because if it is not we always need to keep up with the documentation of php-amqplib issues.
Or do you suggest a change in the Consumer? Please feel free to contribute and open a PR in case you got a suggestion.
Hey guys,
Due to the latest updates in the
php-amqplib/php-amqplib
(I describe them in more details here) the current wayconsume
method is implemented causes an infinite loop in caseblocking
is set tofalse
(which it is by default). https://github.com/bschmitt/laravel-amqp/blob/master/src/Consumer.php#L73This is due to the fact
php-amqplib/php-amqplib
disables timeouts for a non-blockingwait()
(https://github.com/php-amqplib/php-amqplib/pull/642/files#diff-195c265ed9a66166715118df34df6ea3R339) and stops execution instead, leading to anotherwait
cal, and so on, and so on.You may probably want to reflect this in the documentation for
consume
to set thatblocking => true
in config, otherwise it may consume lots of CPU sincephp-amqplib
2.9.