I am developing a web application, wherein I am using Java as my front end and shell script as my back end. I need to process lot of files in shell script, let me assume that I need to process 1000 files in shell script. I am using the following code from Java
for(i from 1..1000)
{
Call shell script to process file i
}
Intenally in the shell script, I am doing some processing logic and storing the o/p in a local file(which can then be accessed from Java).
My requirement is, for everytime the shell script being called, an output is generated to a file. so as an when the control from shell script to java, I have to process it and display it in the front end. But the for loop should not break. It has to carry on with as it is but some front end work of displaying this file should also take place.
I tried searching about this and the recommendations that I got is to use AJAX and long polling for this and also threading. Could you people share some ideas regarding this. Thank you.