Re: Exec Script in the background, don't wait till it finishes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 14 January 2011 18:48, Nicholas Kell <nick@xxxxxxxxxxxxxxxx> wrote:
>
> On Jan 14, 2011, at 12:41 PM, Kai Renz wrote:
>
>> Hi guys and thanks for your answers...
>>
>> @Nicholas:
>> Yes, you are right. The first socket is only used if a new clients
>> connects, thats why the script generates a new port so the client can
>> connect to the new socket. After that socket1 should continue its work
>> and wait for new clients.
>>
>> @Daniel:
>> Yeh i tried sending it to the background, this works but still it does
>> wait for the other script to finish.
>>
>> @Evil Son:
>> Thanks for the tip, i'll try it :)
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
>
> One more thing to verify: What is the target environment? *nix I hope.

You can launch a non-blocking process in Windows using PHP. I do this a lot.

<?php
$o_Shell = new COM('WScript.Shell');
$o_Shell->Run('C:\\PHP5\\php-win.exe -f script.php --
script_params_would_go_here', 0, False);
// This script can now continue and script.php will be running in parallel.
?>

I use WinCache's Ucache to pass data between the multiple "threads".

Now, use the PECL extension Win32Service, and you can use PHP for
Windows Services, multi-threaded with inter-thread communication.

If you feel mad enough.

Regards,

Richard.

[1] http://msdn.microsoft.com/en-us/library/d5fk67ky(v=vs.85).aspx


-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux