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

add pcntl_signal_dispatch after job finish for php extension #485

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "yiisoft/yii2-queue",
"name": "dimanzver/yii2-queue",
samdark marked this conversation as resolved.
Show resolved Hide resolved
"description": "Yii2 Queue Extension which supported DB, Redis, RabbitMQ, Beanstalk, SQS and Gearman",
"type": "yii2-extension",
"keywords": ["yii", "queue", "async", "gii", "db", "redis", "rabbitmq", "beanstalk", "gearman", "sqs"],
Expand Down
8 changes: 8 additions & 0 deletions src/drivers/amqp_interop/Queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,10 @@ public function listen()

$this->redeliver($message);

if (function_exists('pcntl_signal_dispatch') && $consumer instanceof \Enqueue\AmqpExt\AmqpConsumer) {
s1lver marked this conversation as resolved.
Show resolved Hide resolved
pcntl_signal_dispatch();
}

return true;
}

Expand All @@ -319,6 +323,10 @@ public function listen()
$this->redeliver($message);
}

if (function_exists('pcntl_signal_dispatch') && $consumer instanceof \Enqueue\AmqpExt\AmqpConsumer) {
pcntl_signal_dispatch();
}

return true;
};

Expand Down