6 ms·
> To implement progress reporting, it means you are able to know the time a task would take to run upfront, no? No. You just need to know the total number of s
by pbalau 11mo ago
> To implement progress reporting, it means you are able to know the time a task would take to run upfront, no?
No. You just need to know the total number of steps and what step are you currently on.
- ducdetronquito 11mo agoYou're right, but I also don't find a way a task queue library could know that upfront either to implement progress reporting. Does anyone know a task queue library that implement it ? I would be curious to look at it !
- amanzi 10mo agoThe way it's typically done is that the worker process reports back its progress to the job metadata on the queue, and the web worker polls the job metadata to read the progress. I've implemented this for progress bars many times on Django with django-rq. I first learned about it from Miguel Grinberg's Flask tutorial: https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xxii-background-jobs https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial... But the same concept applies to Django.