I need some advice on handling an issue programmatically. I have a web interface on PHP and Javascript(jQuery), on which authorized user needs to control multiple distant entities by performing some actions.
Each entity consists of 10 steps and the progress is represented by a progress bar on which each step is a web service call which needs around 0.5-1,5 to execute. So for the first service for example to be completed 10 different web services are called and when each is fulfilled progress bar proceeds by 10%. Each action is performed with an ajax request.
The problem is, that in the same interface, i have to give the option to the user to control simultaneouly around 800 different entities, and each of them consists of 10 steps which make approximately 10x800 = 8000 ajax calls.
Performing 800 requests per step doesn't seem a good idea, because browser struggles to serve them but often hangs due to the excessive load. I ve thought to make some kind of limited batch action, but haven't settled which option would serve me better.
For instance, shall i use a counter and perform a setTimeout/setInterval every X number of calls? Shall i abandon this approach and use javascript workers?
I ve read similar threads over stack overflow, suggesting for example handling them on the server side. This doesn't seem good option in my case, because on the one hand there has to be a flow on the progress, on the other hand, performing on the server side 800 requests (~0,5-1,5sec) would mean that the user would have to wait without any information at lest ~6 minutes Also other suggest using $.when but i doubt whether this would serve this case as well, since i need to limit the total batch, and not just the response of each request.