Jump to content

Open a URL location with timeout


papaface

Recommended Posts

Hello,

I am trying to work with the API for my website.

Basically I need to load a specific url to instigate a series of functions. The API will call back my script later automatically.

 

I am trying to find a reliable way of invoking a given URL so that it starts processing the API file BUT I don't want php to sit and wait until the API has finished doing its stuff.

 

I want to update a field in my database when the API is run.

 

I have tried if (get_headers($url)), but this takes to long.

I have tried if (curl_exec($ch)) with timeout, but this is unreliable as it seems to start counting the moment curl is exec'd rather than the time from when the url is successfully loaded.

I have tried file_get_contents($url), but like curl this is unreliable.

 

Does anyone have any other ideas as to how I could do this?

 

Any help would be appreciated!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.