PHP Task delegation....as such....

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nonny
Forum Newbie
Posts: 2
Joined: Fri Nov 15, 2002 9:46 am

PHP Task delegation....as such....

Post by nonny »

Is there a way for a PHP script to activate the processing of another PHP function so that it can return data to the client without having to wait for the activated functions to finish?

For example, I have a PHP script that handles large amounts of form data. Some functions will return an "All Ok" page to the client. But only after all the non-client functions are completed, such as database functions and confirmation emails to the webmaster, thus slowing down the time for the page to be sent back to the client. Is there a way for these functions to be run in their own 'thread' so to speak? So the page will be sent back to the client whilst the server processes the other stuff not required for that page?
User avatar
mydimension
Moderator
Posts: 531
Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:

Post by mydimension »

since php is not multi-threaded on a script basis, this is rather difficult if not impossible. you might check out the the tick functions: http://www.php.net/declare they provided a psuedo multi-tasking functionallity that might help. ive never used them so i don't know how they perform.
Post Reply