Jump to content

Pause / Resume a background script?


scooter41

Recommended Posts

Hi There,

 

I am building an application for a client that basically sends out SMS messages via a series of HTTP post requests to a 3rd party server.

 

I am will be using curl to loop through the numbers (around 8000) or so, and can have the script continue even if the user closes down his browser using:

 

ignore_user_abort(TRUE);

 

However, what he would like to be able to do is stop the sending, and resume again another time if need be. The resuming isnt a challenge, I can easily do a counter on each sucesful send and make note of where to start/resume next time in the list.

 

My question is, how would I go about accessing a script that is running in the background, if the user has left the page? Would I access it by a process ID or similar?

 

Im using standard Plesk8 installation on Linux.

 

Any help greatley appreciated, or even a direction on what to look for :)

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/99363-pause-resume-a-background-script/
Share on other sites

Initially I thought about outputing the html for each post, like:

 

Sending 23 of 8000 - CLICK TO PAUSE

Sending 24 of 8000 - CLICK TO PAUSE

Sending 25 of 8000 - CLICK TO PAUSE

 

But my concern would be if his connection was to time out, or perhaps was on a laptop and didnt have the power to leave it running in the browser

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.