How to handle long running requests ?
Consider the following architecture: there is three different endpoints (see picture):
- /generate-transcript (
Resourcein picture): This endpoint initiates the transcript generation process for a specific id (given in body). It handles the initial request from the client to start the transcription task. The app then returns a 202 Accepted and a Location header that contains a pointer to the resource status endpoint. - /transcript-status (
Status Resourcein picture): This endpoint is responsible for checking the status of the transcription process initiated by /generate-transcript. It helps the client monitor the progress and readiness of the transcript. The server responds with an empty 200 OK (or 404 it depends) if the status is unavailable, indicating that the transcript hasn't been generated yet. The client keeps pooling, when the transcript is available the response will be 302 with a Location header that contains a pointer to the transcript resource.
- /transcripts (
New Resourcein picture): This endpoint serves the completed transcript upon successful generation.

