Welcome Guest, Not a member yet? Register   Sign In
Background processing without user waiting
#1

[eluser]yongkhun[/eluser]
Hi all,

I have a time-consuming task to be executed in PHP but I do not want the user to keep waiting until the task is completed. Meaning that, after the user load the controller method, the page will complete loading immediately (browser loading done and not keep waiting), while in the background the controller method will keep on running the time-consuming task.

I have tried the flush() but the browser will still keep waiting. I have heard of cron but I do not want to use cron because it is only possible for Linux environment. I want my code to be able to run both Linux and Win platform.

Any suggestion is appreciated, thanks!
#2

[eluser]tomcode[/eluser]
I am using a hook (post_system) to update thumbs after the output is sent to the browser.
#3

[eluser]Rick Jolly[/eluser]
There are web sites that will allow you to register a cron job. They simply call your script at the time intervals you set.




Theme © iAndrew 2016 - Forum software by © MyBB