by dchuk · 12y ago · 0 comments
Are there any patterns or documentation projects or books or tutorials or anything else out there that cover how to have users submit something into a queue system, provide immediate feedback, then provide accurate progress updating as the job is processed, then show the results, all without having the user refresh their process or navigate away and back again?
Let's say for instance, I built a service that lets a user upload 20 images at a time to be cropped and resized. Is there a commonly accepted pattern for alerting them of the resizing job progress as it is happening?
For sending async results to other servers, use webhooks. They give you an endpoint to call when the job is done processing and you call it when you're done.
Is there a pattern for that type of situation? Some sort of watcher pattern or master job monitoring pattern that allows accurate progress reporting?
If you're talking about generic progress reporting from a tool that doesn't know what the underlying job consists of (i.e. it only knows "started" "done" "errored"), then I'm not aware of any pattern to provide an accurate progress meter. You could perhaps keep statistics on the length of past runs (like some CI servers do for build times), but it would really depend on your application whether users are willing to accept that those progress bars are just a guess and sometimes run over.