Hi All,
I have implemented a REST API in PHP to return data to another application upon request. Some requests can take 30 seconds, some take 2 minutes and others can take up to an hour. If the response takes longer than 2 minutes, l need to respond back to the calling application that l will be making a callback to the calling application, once the data extract completes.
The data request can be small or very large - dependent upon what the calling application requires.
I have Google'ed around and come across the pThreads implementation, but it says that it should NOT be used in an application hosted on a WebServer. Amp looks like what l need, but l need the http response to terminate with the calling application, while the SQL continues to be generated - i.e. the http request to continue.
The other solution, that l want to avoid is to mark certain requests as long running - since some requests can take 30 seconds at certain times of the day, but exceed 2 mins at other points of the day.
The requirements are as follows:
The issue is that once the SQL Request is running, the program blocks until it completes. I need the SQL request to run in a separately, and monitor how long it is taking.
Can anybody provide some sample code, and framework/ library that can help with the above?
I would gratefully accept any help with the above.