I wrote a system on Web2py to a client, and he wanted me to automate a procedure. I thought about using Ajax. The idea is as follows:
I have a list of companies. Let's say, 50. I want the screen to open with the list of companies and, on top of them, that has a "Start" button. When I click "Start," the page sends the server an Ajax request asking it to perform a calculation for the first company. This is done because it's a heavy calculation, and leaving everything in a request would cause nginx to return a timeout and the calculation would not go through.
I already know how to update the status on the screen. Now comes my doubt.
After the calculation of the first company, the calculation of the second company is automatically called. After the second, the calculation of the third, and so on, is called until the calculation of the others is completed:
Empresa 1: Ok!
Empresa 2: Ok!
Empresa 3: Processando...
Empresa 4: Aguardando...
...
The idea is that I can also pass some parameters beyond the company code, such as a date range, to the calculation.
How can I do this? Should I use pure Ajax or can I use a JS package for this?