When an API operation takes more than a few seconds, waiting for it to finish in one request can strain connections and waste server resources if the connection fails. Start the work asynchronously, then let the consumer check its status or receive a notification. section 14.7
Common design choices include:
- Return a reference to the running operation and let the consumer poll for status. section 14.7.1
- Use a provider-initiated callback, similar to a webhook, to avoid polling; alternatively, let consumers choose an execution mode with the Prefer header. section 14.7
Stock market simulation
A simulation that can take an hour should not keep its POST request open until completion. Return 202 Accepted with the operation status and a Location header such as /simulations/12345. The consumer can poll that URL for IN_PROGRESS or DONE; progress, estimated completion time, or Retry-After can help guide polling frequency. section 14.7.1

