How to handle a request for data that is not yet ready
I have a server that accepts JSON requests. This server connects to
various API's, collects data and arranges it based on the client request.
If a client requests data, but I am still in the process of
downloading/manipulating required data from another API from the server,
then what is the best way to handle this ?
Right now I can think of two options;
Wait until the data is ready, and then send the response.
Tell the client it is not ready yet and to try again soon (in 5-10 seconds).
Which one of these would be more appropriate ? Is there a standard way of
dealing with this situation ?
Thanks.
No comments:
Post a Comment