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.

You send a request to the server, message A is returned after a while, and message B is returned after another period of time.

WBOY
WBOYOriginal
2016-08-10 09:07:201053browse

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?

Reply content:

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.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn