What does laravel queue mean, how it works, and in what scenarios will it be used? What does laravel queue mean, how it works, and in what scenarios will it be used?
Reply content:
What does laravel queue mean, how it works, and in what scenarios will it be used?
The queue here should be a message queue. queue operations include queuing and queuing. That is, you have a program that generates content and then queues (producers)
Another program reads the content, and the content goes out of the queue (consumer ).
When should the queue be used?
When you do not need to obtain results immediately, but the concurrency cannot be infinitely large, it is almost the time when you need to use message queue.
The most common problem is the push notification of the App. when the App user group triggers many operations, it should notify the target user, it is impossible to execute the push code in each operation, which will reduce the processing speed of this interface. you do not need to know whether the target user can be notified if the operation is successful, instead, insert the operation data to a bucket (Memcache
,Redis
), And then start a process to execute the data push in the storage.
Laravel 5.2 service-queue
It is the queue in the data structure. The typical operation method is first-in-first-out, which can be used for all tasks with such requirements.