Re: Multi-threading in PHP
| From: | Andrei Zmievski | Date: | Sat, 11 Aug 2001 15:45:14 +0000 |
| Subject: | Re: Multi-threading in PHP | ||
| References: | 1 | Groups: | php.gtk |
| Request: | Send a blank email to php-gtk+get-2791@lists.php.net to get a copy of this message | ||
On Sat, 11 Aug 2001, Sander Roobol wrote:
> Is it possible to create multi-threaded applications using PHP?
> I know that this is not a specific PHP-GTK question, but I think it's only
> usefull in stand-alone applications.
>
> What I want sounds simple: I want to download multiple files via HTTP (using
> fsockopen, fgets, fputs, etc) while the GUI keeps responding to userinput
> (ie., to cancel one of the downloads).
What you should do is periodically check for GTK events in your download
function and process them, like this:
function download()
{
...
if (gtk::events_pending())
gtk::main_iteration();
...
}
-Andrei
Politics is for the moment, an equation is for eternity.
-- Albert Einstein