I heard that swoole is very popular. If you want to know more about it, let’s start from the official website.
http://www.swoole.com/
What is Swoole
Swoole, PHP's asynchronous, parallel, multi-threaded network communication engine.
What is asynchronous?
My simple understanding is that for processes, asynchronous is opposite to synchronous.
Synchronized process: When the program issues a function call and the process operates, it will not return a status until the result is obtained, and the operation will not continue. That is to say, for a process, one thing is done one after another. The previous thing is not finished. Although the instruction is issued, it still has to wait for a response. Only after getting the response can it continue to do the next thing.
Asynchronous process: When the program issues a function call, the process receives the notification and does something. The program will not wait for the response result of this call and continue to do the next thing. That is, the program only focuses on doing one thing after another, and does not pay attention to the response results of each thing. After each event is completed, there are other notifications, callbacks, etc. to notify the program of the final execution result of the event.
What is parallelism?
Parallel means that the operating system can do multiple things at the same time, and these multiple things can not interfere with each other.
For example, a system that can be parallelized can build multiple processes, each process does one thing. These things can be done as a big thing that is slightly related to each other according to your design, or they can do their own things without affecting each other. .
Concurrency and parallelism are different concepts.
Official website video notes
weiwan
Reference
http://www.swoole.com/
The above introduces the first experience of PHP|swoole, including the content of wool and php. I hope it will be helpful to friends who are interested in PHP tutorials.