FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


How to Skip a process





Philip
we know we can set_time_limit(0); and set ignore_user_abort(2); the process wont stop,

but still there's a question, how about i record a the process on a databases, and write still processing. after the process has finished it will update the still processing to processed.

but i don;t want the user wait until the processed. so is there a way to skip a script processing to a user ?

thanks, Smile
hexkid
Philip wrote:
but i don;t want the user wait until the processed. so is there a way to skip a script processing to a user ?

Set up a cron job to read the database, do the processing, and update the database when finished.

So ... let's say user asks for lengthy process.
What you do is write to the database something like this
Code:
user | process | status
  42 | LENGTHY | WAITING

Then, when the cron job starts (every hour or whatever you feel is appropriate) you read all jobs with status==WAITING, update them to PENDING, do the lengthy process, and finally update those records again to FINISHED.

With these three status codes, the user can know if his process is still WAITING or if it's RUNNING or if it's FINISHED
Related topics
Windows Tips&tricks!
Speed up hosting process!
Anti spyware
Process Manager?
PHP Tutorial: Basic Shoutbox w/ MySQL
Two heck of a nice idea
Boot up Windows XP 60 times faster
Fortran Tutorials(77)
Urban Legends About the Iraq War
More front page news NOT on the front page..
Bush Violates Terrorists' Nuclear Privacy
Software Process Dashboard vs jmove
Give me a HOLLA if you are a fervent agnostic!
pls suggest software to generate thumbnails etc...
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.