I'm in a codeigniter environment and I want to do something like this.
There is a chatroom with a single O-wner and some C-lients.
This is what I'm trying to write

1) C joins the room. 

2) when ready, all Cs clicks on a "ready" link that sends an ajax request

3) C waits for all the Cs to get ready, then signals all client and the previous ajax reponses are sent 

4) when C receive the response (which should be in the same moments for all the clients) they start doing what-they-have-to-do :)

Is there an easy way to keep track of all the clients connected so that I can signal them all simultaneously? 

For now I'm stuck at step 3. I have a code like this

```
$.ajax({ 
url: 'myurl.php',
success: function() { doStuff(); }
});

```

and in my hypotethic file myurl.php i have 

```
while ($this -> MyModel -> waitingQueue) {
sleep(1) }
return "ok";

```

I guess this is not a good approach since I can't control whether all the clients receive the responses in the very same instane, when I change in my model the variable "waitingQueue".

Thanks all!