The queue implementation seems simple. I would like to ask, for example, when sending a large number of emails, entering the queue and eliminating the queue are definitely not performed at the same time. For example, I call inqueue. php adds the email address to be sent to the queue, dequeue. PHP sends emails and removes the queues... the queue implementation seems simple. I would like to ask, for example, when sending a large number of emails, entering the queue and eliminating the queue are definitely not performed at the same time. For example, I call inqueue. php adds the email address to be sent to the queue, dequeue. PHP sends emails and removes the queues. Are these two certainly not running together ?. Or in queue. php, what is the difference between advanced queues and loops in eliminating queues?
Who can explain the actual use of the queue by sending a large number of emails?
Reply content:
The queue implementation seems simple. I would like to ask, for example, when sending a large number of emails, entering the queue and eliminating the queue are definitely not performed at the same time. For example, I call inqueue. php adds the email address to be sent to the queue, dequeue. PHP sends emails and removes the queues. Are these two certainly not running together ?. Or in queue. php, what is the difference between advanced queues and loops in eliminating queues?
Who can explain the actual use of the queue by sending a large number of emails?
You don't need to consider how queues operate. You just need to use existing queues, such as httpsqs, simple message queues, first-in-first-out, http operations, and ease of use, only link to the columns and columns. What is the purpose? For example, sending emails, writing a large amount of data, sending text messages, or performing asynchronous operations, the queue should be completed as far as possible.
Refer to this: http://segmentfault.com/q/1010000000750317/a-1020000000750367
In essence, it is asynchronous and blocking.
No queue
Go to the operating platform
Click send.
......
......
...... No response ......
Or add a progress bar.
After N minutes, the operation is completed.
In this process, you cannot perform any operations.
Queue
Go to the operating platform
Click send.
(I want to wait. I want to be lazy. It's over)
Continue with other operations.
I raised this question a few days ago. It is similar to yours here.
Now I want to solve the problem by handing the task to the backend for execution. The advantage of the queue is that you have sent a task and handed it to the worker for execution, you can continue to do what you want, and then use event listening to record whether each entry is successfully executed and then eliminate it.
In php, it would be nice to use gearman, or redis to process the queue.