Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to disable non-blocking mode #296

Closed
wants to merge 3 commits into from
Closed

Allow to disable non-blocking mode #296

wants to merge 3 commits into from

Conversation

MorrisonHotel
Copy link
Contributor

@MorrisonHotel MorrisonHotel commented Dec 30, 2019

With non-blocking mode we have CPU usage ~100%.
So, lets declare an option for rabbitmq:consume command to toggle this behavior.

Actualy, I'd rather to set up non_blocking=false while channel is waiting, by default. But, maybe it's a BC breaking change.

php artisan rabbitmq:consume - current behavior (with non-blocking mode)
php artisan rabbitmq:consume --blocking - with blocking mode

@MorrisonHotel
Copy link
Contributor Author

@vyuldashev ping

@vyuldashev
Copy link
Owner

Blocking mode is not a solution because timeouts will not work. I will provide fix based on this approach.

@vyuldashev
Copy link
Owner

Fixed in v10.1.3.

@vyuldashev vyuldashev closed this Jan 11, 2020
@SlayerBirden
Copy link

Blocking mode is not a solution because timeouts will not work. I will provide fix based on this approach.

@vyuldashev I think you're wrong on this one. Blocking mode is exactly the mode where timeouts are actually used. See https://github.com/php-amqplib/php-amqplib/blob/1252cfbab6342dd36f5c5f1af70b6085bfcf60f8/PhpAmqpLib/Channel/AbstractChannel.php#L345

There's no point in timeouts for non-blocking mode, because it's not actually waiting.

@vyuldashev
Copy link
Owner

@SlayerBirden by timeout I mean timeout parameter in rabbitmq:consume command and timeout in job.

@SlayerBirden
Copy link

@vyuldashev in that case I'm not sure how it's connected to blocking mode.

As I understand it blocking mode affects how channel->wait works (limits how long we're waiting for a message), while timeout in rabbitmq:consume affects Laravel's runJob (limits how long job works).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants