I will give a banal example about taxis. The client orders a taxi and presses the order button, then the data went to the server and the order went to the taxi driver. When the order is received, the answer goes to the server with data about the driver or with what they come there (it does not matter). The client receives an answer and looks for information about the driver.
How does the customer get a response with the information? After all, after sending there, everything does not happen right away, for some time the order weighs in anticipation until it is accepted and then the data from the information is received to the specific client when the order is accepted.
How to make a similar thing, maybe there is material on this topic or something else that you can advise to read.