I’d like to:
- Send request from the browser to a python CGI script
- This request will start some very long operation
- The browser should check progress of that operation every 3 seconds
How can I do that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
On the server side, you should probably look into some background queue / job runner of sorts, otherwise your request will be blocked once the long operation starts (depends on your server). I hear Celery is pretty good. On the client side, do some polling every x seconds that checks the job status. If you’re feeling adventurous, you could experiment with websockets, although they’re not supported natively in all browsers (you could use 3rd party extensions to try and accomplish cross browser support).