Home > Software design >  How to communicate completion percentage from backend to front end
How to communicate completion percentage from backend to front end

Time:07-04

Ok so I have a Django backend that performs some tasks and one of the queries computes a complex calculation that can take from a couple of seconds up to 15 minutes based on the entered data.

The point is, I have a loop that I can calculate the completion percentage from however I cant figure out how to send an update query saying something like {'completion':20} every loop iteration.

Frontend is Node hosted on a separate server.

CodePudding user response:

Requests should come from the client side. Hold the updated completion value in a model in the backend, send an AJAX request from the client side and ask for the latest completion value, get your response and display it.

  • Related