The difference between synchronous interface and asynchronous interface and the implementation method

the difference:

First of all, let's understand the concept:
synchronization means that when a process executes a certain request, if the request takes a while to return information, then the process will wait until it receives the return information before continuing to execute; synchronization It is equivalent to when the client sends a request to the server and waits for the server to respond to the request, the client does not do other things, and returns to the client when the server is done. In this case, the client needs to wait all the time, and the user uses It will look unfriendly.

Asynchronous means that the process does not need to wait forever, but continues to perform the following operations, regardless of the status of other processes. When a message is returned, the system will notify the process to process it, which can improve the efficiency of execution. Asynchrony is equivalent to when the client sends a request to the server, while waiting for the server to respond, the client can do other things, which saves time and improves efficiency.

In short:
synchronous: refers to sending a request, needs to wait for the return, and then can send the next request, there is a waiting process ;
asynchronous: refers to sending a request, does not need to wait for the return, and can send the next request at any time, that is, no Need to wait .

Implementation method: XXXXX

Acho que você gosta

Origin blog.csdn.net/qq_39877681/article/details/130289895
Recomendado
Clasificación