mardi 16 août 2022

Why is there a "Get Status" step when implementing Async APIs w/ Polling?

Often times I see the following for polling:

  1. Send a request and get a unique ID back.
  2. Poll a "Status" endpoint, which tells the client when the request has been completed.
  3. Send a request to fetch the response.

Can't steps (2) and (3) be combined? If the response isn't ready, it'll return no response back, and some status indicating that. If it is ready, it'll return the response.

Why is (2) and (3) often separate steps?

Thanks!

Aucun commentaire:

Enregistrer un commentaire