I'm a somewhat new web designer and developer working on a public health project to estimate the course of HIV/AIDS in a population in different countries. Our test version is here: http://globalhealthdecisions.com/test/tool/
We built this epidemic model in Ruby. The model calculates the different probabilities of sexual interaction and disease transmission between groups for each year. Currently, it runs through ~40 years and at the end, outputs the final results as a JSON object. The script takes ~8 seconds to complete running it in the CLI. I've implemented a front-end for the model, and with the AJAX request, it can take up to 30 seconds to receive a response from the server.
My question: is there a way for me to receive an update from the server as the model is being calculated? Ie, could I calculate one year, output that year, have it sent to the client, while still running the current execution of the Ruby script? If so, in this "push" manner, I could load each year as it is received, decreasing wait times significantly.
Thanks so much.