Home> PHP Framework> YII> body text

Execute multiple queues using yii2-query

王林
Release: 2020-02-19 15:12:15
Original
2578 people have browsed it

Execute multiple queues using yii2-query

Using yii2-query to execute multiple queues examines everyone’s understanding of the yii2-queue library. Yes, it is a component, which means we can use yii2 Create a queue component in the queue, or you can create N queue components.

So when we want to deploy multiple yii2-queue queues in yii2 applications, it becomes deploying multiple yii2-queue components.

(Related tutorial recommendations:yii framework)

Suppose we now want to use two queues in our yii2 application, one is of file type and the other is of redis type , the configuration is as follows:

Execute multiple queues using yii2-query

This is enough. Of course, for the use of these two components, the following form is required:

Yii::$app->queue1; Yii::$app->queue2;
Copy after login

This is the component Instructions.

When we want to call the worker to execute, we also need two commands on the command line.

php yii queue1/listen;// or queue1/run php yii queue2/listen;// or queue2/run
Copy after login

That’s it.

For more programming related content, please pay attention to theProgramming Introductioncolumn on the php Chinese website!

The above is the detailed content of Execute multiple queues using yii2-query. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!