-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: callback for when all everyone.now.methods have executed #49
Comments
So right now if you do this, the callback you pass in will be called once for each client, in that client's this.now context. To get the amount of clients connected you can do what you're doing now. We may add a client count feature so you can easily get the number of clients in a group. Providing a callback (that runs once) when all callbacks have completed is easy to do, internally it would have to be a counter kind of like what you have now. The difficulty lies in the syntax. Not sure how you would pass this callback in during a remote function call on a group |
@ericz, at the moment I am not doing this because I cannot get the max count. How would I achieve this functionality now? |
Oh duhh. My bad you're right you don't have the max. I'll see if its easy to expose a way a count and get back to you |
Ok this now exists in the master on github. Simply do everyone.count or somegroup.count to get the number of users at the time. Make sure you are careful as its possible that the remote call does not return before the usercount changes. This is an undocumented feature and the api for this will probably change in the future |
@ericz, thanks. Should a new issue be created such as "document group.count and improve API" or do you have an internal ToDo? Just figured that it should not be forgotten |
I have an internal todo already so no issue is necessary, thanks! On Thu, Apr 14, 2011 at 9:39 AM, tommedema
510-691-3951 |
I'm in this situation: I have an incoming stream and receive a chunk. I wish to send this chunk to all now.js clients, but need to pause the stream until all clients have received the chunk.
I can do something like this:
client:
and on the server:
But:
I'm not 100% sure, but it might be a good idea to add a callback to remote function calls for when all clients have received this method. I'm not sure of the implications and overhead involved though...
The text was updated successfully, but these errors were encountered: