Home > Article > Backend Development > You send a request to the server, message A is returned after a while, and message B is returned after another period of time.
Messages need to be returned by the server
I am currently using thinkphp for development. The front-end user initiates a request, the server processes the request, returns an A message, and then the server continues to process it, and then returns the B message
What I am using now is
$this->ajaxReturn($info). This thinkphp comes with a method, but after returning, the next operation cannot be performed. How to break it?
Messages need to be returned by the server
I am currently using thinkphp for development. The front-end user initiates a request, the server processes the request, returns an A message, and then the server continues to process it, and then returns the B message
What I am using now is
$this->ajaxReturn($info). This thinkphp comes with a method, but after returning, the next operation cannot be performed. How to break it?
This is because the link has ended this time, so B cannot be returned. You can make a long link
or request data from the server at an interval
The front desk performs detection. After receiving the first response, it re-requests the second result or websocket.