How to answer in the php ajax request in progress?

Please tell me how to implement the task:
There is an ajax request from front to Beck. Send parameters to php, and he, in turn, in a loop makes the necessary calculations.
Before, when I had to get one response, I was writing in die() variable with the value of the executed result and ajax success received this response and working further with him in the front.
I need that during the execution of the loop in Php after each iteration, ajax get an answer, perform calculations, iteration and sent consistently result in success. What to use instead of die()?
This is to display the progress of process.
April 19th 20 at 12:23
1 answer
April 19th 20 at 12:25
Websocket. Or to reconsider the interaction with the server.
Well, why just the websocket, the progress works fine on
There are features of the implementation, because in a very big pause between the chunks, the connection falls off, but quite feasible. - Walker commented on April 19th 20 at 12:28
@Walker, that fact that we do not know the time of processing) on the basis of the question I guess it takes time, and it means that with a single query we receive the response signals with uncertain time delay. - Naomi_Schup commented on April 19th 20 at 12:31
@Naomi_Schup, you can Always count in one cycle, progress to give to another, guaranteed time of return. Although I do not pretend, in PHP or bumbum, I nod did. - Walker commented on April 19th 20 at 12:34

Find more questions by tags PHPAJAX