You are here: Re: [PHP] Executing process in background « PHP « IT news, forums, messages
Re: [PHP] Executing process in background

Posted by Jasper Bryant-Greene on 10/21/05 04:28

On Thu, 2005-10-20 at 15:07 -0700, Surya Mishra wrote:
> I have to start a task on the server side that is going to take pretty long
> to process in the server side. So I would like to show a message to the user
> and ask him/her to check again later. But starting a new task holds up the
> thread and won't let me exit the php. The user's browser does keeps showing
> busy.
> I tried to create a new thread using pcntl_fork, but my php doesn't allow
> that as it has not been compiled with pcntl support and its not possible to
> change that.
> I also tried to create a script that would do the task and called the script
> using system command and passed an '&' at the end to make it process in
> background, but that also keeps the main thread busy.

Add it to a list (flat file, DB, whatever) of processes to be done and
run a cron script regularly (how regular would depend on the specific
app) to execute all the processes in the list.

--
Jasper Bryant-Greene
General Manager
Album Limited

e: jasper@album.co.nz
w: http://www.album.co.nz/
p: 0800 4 ALBUM (0800 425 286) or +64 21 232 3303
a: PO Box 579, Christchurch 8015, New Zealand

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация