I am trying to retrieve some data from an API using CURL request. Is it possible to track the time passed from request start and stop the request after sometime, may be less then the timeout set to it?
NOTE:
My aim is to not set timeout. Let the request continue until another job/function call don’t arise. Is it possible?
In Detail:
What I exactly want is that, I have a function that call through Ajax and then a CURL start, and another Ajax will also call that function with some specific parameter, when second ajax call happen then the execution of CURL should stop. But the time interval within these two call is arbitrary.
Then you need to do that in your JavaScript code. Simply
.abort()the previous AJAX request before sending a new one.