The request that waits for a video to encode
Uploading a video posts to the API, which encodes it inline and then returns. Encoding takes ninety seconds. The load balancer times out at sixty, the client sees a failure, the user uploads it again — and now two encodes are running.
The work is legitimate. Holding an HTTP connection open while it happens is not.
Break the long job off the request path.
Components — tap one, then tap a slot on the diagram
!Every upload fails at sixty seconds, and each retry starts a second encode.
Outside every boundary: Client, Object store (the finished file), API (returns immediately; FAILED: timing out), an empty slot for the hand the job off, an empty slot for the do the work Connections: Client calls API — upload (step 1) API publishes to hand the job off — enqueue job (step 2) hand the job off publishes to do the work (step 3) do the work calls Object store — write result (step 4)
Client
Object storethe finished file
APIreturns immediatelytiming out