AFAIK, when "other people" open "other pages" the server will handle
the request separately, so as an example:
if in sleep.php you have this code:
<?php sleep(10); echo "Hola"; ?>
and in nosleep.php you have this code:
<?php echo "Hola"; ?>
then if you run sleep.php it will take 10 secs to show the message
while in the meantime you can open and refresh as many times as you
want the nosleep.php script that you will see a bran new message,
while the other php script is still working because of the sleep(10)
call.
Hope it helps.
On Oct 27, 2008, at 11:02 PM, Matias wrote:
>
> But if I leave the new process in the background, it wont leave the
> user waiting.
> For example if you want to use a comet like chat, you'll want to leave
> the server waiting for a new message to return to the client. So I
> need to leave the user waiting but that this dont affect the rest of
> the people navigating other pages.
>
> On 27 oct, 11:53, alvaro <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> I think that with one process that's not possible.
>>
>> The sleep function will delay the program execution for the specified
>> amount of seconds, so... what you tell is happening is what should
>> happen with that function.
>>
>> So in your case I would recommend to spawn a new process in the
>> background for whatever you need to do .
>>
>> Cheers
>>
>> On Oct 27, 2008, at 10:36 PM, Matias wrote:
>>
>>
>>
>>> Hi there!
>>> I have a problem and maybe you guys could help me to resolve it…
>>> if i have this function:
>>
>>> public function executeSleep()
>>> {
>>> sleep(10);
>>> }
>>
>>> and if i run this function, i can’t run another function in the same
>>> project untill this 10 seconds are finished…
>>
>>> Obviously, I don’t need a sleep(10) in my code, but I have some long
>>> process in one of my functions…
>>
>>> I Hope you can help me… thank you veeery much!
>>
>>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---