harvard-lil / h2o

H2O is a web app for creating and reading open educational resources, primarily in the legal field
https://opencasebook.org
GNU Affero General Public License v3.0
37 stars 30 forks source link

Poll or wait for completion of async PDF generation job #1891

Closed lizadaly closed 1 year ago

lizadaly commented 1 year ago

Generating a PDF title will trigger the following workflow:

The job will either write a completed PDF, error, or time out.

If the job succeeds:

If the job errors:

If the job times out:

lizadaly commented 1 year ago

There are lots of implementation options for polling for job completion. What do the other projects do?

rebeccacremona commented 1 year ago

There are lots of implementation options for polling for job completion. What do the other projects do?

Perma tracks every request to make a Perma Link in a CaptureJob table. As the job runs, we update its status field, along with some progress indicators. That info is exposed in an API route. The frontend's JS hits that route every so often and advances a progress bar; we've heard some feedback that the progress bar isn't the best design choice.

The prototype capture service is set up the same way, but is tidier, including a Vue frontend.

As far as I know, CAP doesn't have any user-facing tasks or polling; probably worth confirming that with someone else.

lizadaly commented 1 year ago

This is done!