The most recent one heard a word: task queue.
What does the task queue mean?
I myself have an understanding, that is, for example, users use mail registration, registration is successful to send a message to the registered mailbox. Because sending messages is a time-consuming operation, placing messages asynchronously in the queue does not occupy the main thread. Is the use of the queue a scenario like this?
Ask the great God for answers, preach!
Reply content:
The most recent one heard a word: task queue.
What does the task queue mean?
I myself have an understanding, that is, for example, users use mail registration, registration is successful to send a message to the registered mailbox. Because sending messages is a time-consuming operation, placing messages asynchronously in the queue does not occupy the main thread. Is the use of the queue a scenario like this?
Ask the great God for answers, preach!
Yes, u 2 right.
can provide you with a plan to maintain a list in the Redis, business code to the list to insert e-mail address, another script from the Redis inside read the email address, specifically to do the job of sending mail.
I wrote a blog that gives examples of PHP and Redis implementation queues: http://upliu.net/php-use-redis-as-queue-service.html
In addition, a naturally asynchronous development language, such as node. JS, does not block the running of the script while it is making a network request (the scenario for the main problem is sending the message).
Of course it is also possible to use multi-process, fork out a child process inside the main process, and then the child process to send the message, the main process continues to execute its logic. But I think it hurts so slightly
That's the way it is. But I don't usually use PHP to do this kind of continuous operation.
My understanding of what to do in order is to use the team example.
Even if you are Keiko threads, why not more than a few sub-threads parallel processing?
Slightly shallow, seeking light spray.