How to respond to an API-Client routine in a timely manner.
If the data from our requests are being processed/handled in an advanced manner, such as querying or fed into a database, the following sequence of events to be adopted:
- Receive the request
- Write the query string to a buffer.
- Respond with the "200 OK" status to complete the HTTP transaction.
- Handle the buffer data, ideally by an independent process.