What does the Laravel queue mean, and what is the principle of implementation?

Source: Internet
Author: User
What does the Laravel queue mean, what is the principle of implementation, and what is the general scenario used in the queue?

Reply content:

What does the Laravel queue mean, what is the principle of implementation, and what is the general scenario used in the queue?

The queue here should refer to the message queue, the operations of the queue are queued and out of team. That is, you have a program that produces content and then the queue (producer)
Another program reads content, content out of the queue (consumer).

And when does the queue use it?

当你不需要立即获得结果,但是并发量又不能无限大的时候,差不多就是你需要使用消息队列的时候。

Most often encountered is the app push notification, when the app user group triggered a lot of actions to notify the target user, it is not possible to execute push code in each operation will reduce the processing speed of the interface and users do not need to know whether there is no notification to the target user as long as the operation can be successful, Instead, the operation data is inserted into a storage ( memcache , redis etc.), and then a process is executed to execute the data push within the store.

Laravel 5.2 Service-Queue

Is the data structure inside the queue, the typical operation is first-out, all have (first-out) such requirements of the task can use this data structure.
More information on the data structure of the queue can be searched by the search engine by itself. Because queues also have circular queues, priority queues, and many other categories.
The implementation of the principle, in fact, is to achieve the general operation of the queue, such as the into row. Generally will implement a plurality of driver, so-called driver, is how to implement the queue. such as text file mode, DB mode, Redis, Monolog.
Usage scenarios are usually queued tasks, such as robbing tickets, killing seconds, etc.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.