I have a classic asp page that when running do a lengthy check repeatedly calling 20 times the same vbscript function each time with different argument. The function returns either true or false (depending on the argument). Each time the function runs it takes 5-6 seconds. So the whole time is 5*20=100 seconds. It is not an acceptable time the user to wait. I improved things a bit by using Response.Flush()
after each calling to the function so the temporary results published immediately to the browser. BUT I believe that to run the function 20 times asynchronously collecting all the responses to an array is the best solution. I have found that there is a way to use asynchronous calling in server side asp like we use ajax in client side but all the examples use only one asynch calling using MSXML2.ServerXMLHTTP
or Microsoft.XMLHTTP
.
https://gist.github.com/micahw156/2968033
How do I fire an asynchronous call in asp classic and ignore the response?
I think you need to rethink your approach to this. Instead of calling the function in server side ASP code, why not make the call from javascript? You could display all 20 lines in a table with the arguments displayed, and each row would be a separate async api call to your function. The call to the function could be a simple .asp page which takes whatever arguments are necessary to run the function and return the result.
Then your html table can be updated as the function returns.