title: Turn based web game in PHP - communication issue
body: <p>I am working on a turn based web game in PHP5.</p>
  
  <p>This is pretty simple game, a kind of board game: two people join a "session" and they play until one of them wins.</p>
  
  <p>My problem in nutshell:</p>
  
  <ul>
  <li><p>User A and User B play a game.</p></li>
  <li><p>User A finished his turn</p></li>
  <li>Request will be sent to the server to perform necessary operations.</li>
  <li>Now it is time for User B to move..</li>
  </ul>
  
  <p>But how could I notify User B about this?</p>
  
  <p>I mean, now the server has to communicate with the other user, the one that is inactive, not the one that initiated the request.</p>
  
  <p>I know that this could be implemented using some kind of periodic AJAX call that checks whether the opponent finished his turn etc, but such a thing generates a huge number of requests.</p>
  
  <p>Isn't there a better way to solve this? </p>
  
  <p>I'm thinking of something like this:</p>
  
  <ul>
  <li>User A's turn ends </li>
  <li>Server saves his score</li>
  <li>Server contacts User B</li>
  <li>User B's turn gets started.</li>
  </ul>
  
  <p>Is this possible using PHP and comet-style requests somehow? Or is there a better way to do this?</p>
  
  <p>Any help would be appreciated!</p>
  
  <p>Thanks in advance!</p>