Advertisement

05.02.2008 at 11:14AM PDT, ID: 23372504
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.6

PHP - Asynchronous Request Handling (on the server)

Asked by dmagliola in PHP Scripting Language, Apache Web Server, WebApplications

Tags:

I want to make an app, quite similar to a chat system, in which the client will poll the server for news CONSTANTLY. The obvious way is to have the client poll every "x" seconds, which depending on the value of "x" will either get unresponsive on the client, or will kill the server.

A method I found, and have successfully implemented in .Net is not responding to each poll with "nothing new here" every time, but instead keeping the client request (not responding at all), and only responding when there's effectively something to tell (or when something like 30 seconds go by, so as not to time out on the client)
Now, the "normal" way of doing this implies that while the server is not responding, it keeps a web server thread busy, which implies that i need 2000 threads if I have 2000 people on the client. (If I'm understanding this correctly)

.Net gave me this magical solution called  "asynchronous handlers" that let me release the thread, but not reply to the client, and then only reply when i have to, using another thread (and a magical object I keep a reference to, which is the user's request). This lets me scale wildly while i still have only very few threads on the server.

Is it possible to do something like that in PHP?
Or at least, in ANY *nix environment at all (taking into account the fact that i'd like to avoid having to write my own web server)? (I can learn other languages like Python if I have to)
Has anyone heard of an approach like this that I can use?

Thank you very much in advance for your help
Daniel MagliolaStart Free Trial
 
Loading Advertisement...
 
[+][-]05.02.2008 at 11:20AM PDT, ID: 21488854

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.02.2008 at 11:35AM PDT, ID: 21488987

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.02.2008 at 12:36PM PDT, ID: 21489453

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.02.2008 at 02:45PM PDT, ID: 21490235

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 07:54AM PDT, ID: 21500459

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PHP Scripting Language, Apache Web Server, WebApplications
Tags: php
Sign Up Now!
Solution Provided By: StephenJaffe
Participating Experts: 2
Solution Grade: B
 
 
[+][-]05.05.2008 at 09:12AM PDT, ID: 21501009

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628