Re: [PHP-GTK] Multi-threading in PHP

[email protected] (Andrei Zmievski) Sat, 11 Aug 2001 10:45:14 -0500
Newsgroups php.gtk
Message-ID <[email protected]>
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