2011/6/3 Adam Richardson <simples...@gmail.com>

> On Fri, Jun 3, 2011 at 3:43 AM, 李白|字一日 <calid...@gmail.com> wrote:
>
>>
>>
>> 2011/6/3 Adam Richardson <simples...@gmail.com>
>>
>>> On Fri, Jun 3, 2011 at 2:20 AM, 李白|字一日 <calid...@gmail.com> wrote:
>>>
>>>> is there an efficient way to hold the requests while loop is an
>>>> expensive way in most cases.
>>>
>>>
>>> You can call sleep(number_of_seconds_to_sleep) within the while loop to
>>> lower the cost, so to speak.
>>>
>> yes, an interrupt will be a better way. currently libevent is in beta
>> state, and i don't know if the libevent extension can be used in mod_php to
>> implement comet applications.
>>
>
> Oh, I see. Yes, I'm not sure I'd try using that extension yet.
>
>
>>
>>>
>>>> and i don't know how to notify the holding connections if the change
>>>> need to be notify to the holding requests?
>>>>
>>>
>>> Sorry, I'm not sure what you mean here.
>>>
>>
>> please forgive my poor english, i mean we may have projects need
>> interaction with mulitple users and the state changes of one user should be
>> send to the users involved, like online games chatting rooms.
>>
>
> I believe I understand you, now. This could get costly in terms of
> resources, and I now better understand your interest in the libevent
> extension.
>
> I'd be tempted to write custom C extensions for a web server like nginx,
> which naturally handles asynchronous IO. And, in this case, you could even
> make use of fast polling instead of long polling, due to the performance of
> nginx, such as demonstrated in the this example:
> http://amix.dk/blog/post/19414
>

thanks for the advice,
but i don't know if it can be integrated into web pages.
where in web pages,
browsers will stop the requests to different ports even when the url having
the save domain name.

if i want to host more pages, add more interactions, it would be every
difficult.

so it would be better to have php solutions to make it easier :)


>
> And, don't worry about your English too much. My Chinese stops after ni hao
> ;)
>

ni hao is a good start:)

>
> Adam
>
> --
> Nephtali:  A simple, flexible, fast, and security-focused PHP framework
> http://nephtaliproject.com
>

Reply via email to