Search code examples
pythonhttp

When making an HTTP request, should I wait for the job to finish or make the job send another HTTP request back to me?


I am making a HTTP request to request a job that will do something internally, then when this job finishes I want to know if it succesfully finished.

Should I wait for the job to finish before getting a response and check whether I got a 2XX or 3XX?

Or should I make the job send a seperate request back while I wait.

The job might take 30sec to 5 minutes.


Solution

  • I have decided to have the client (the one who waits) to send a request and expect an 'immediate' response. And then on another thread expect a response from when the job finishes.