I just looked at the Juggernaut for a while, so answer my answer with salt ...
- You might be interested in the Channel object (https://github.com/maccman/juggernaut/blob/master/lib/juggernaut/channel.js). You will notice that Channel.channel is the object (think ruby hash) of all existing channels. You can set a 30 second recurring timer (setInterval - http://nodejs.org/docs/v0.4.2/api/timers.html#setInterval ) to do something with all your channels.
What to do in each iteration of the loop? Well, the link to the above channel code has a publishing method:
publish: function(message){
var channels = message.getChannels();
delete message.channels;
for(var i=0, len = channels.length; i < len; i++) {
message.channel = channels[i];
var clients = this.find(channels[i]).clients;
for(var x=0, len2 = clients.length; x < len2; x++) {
clients[x].write(message);
}
}
}
So, you basically need to create a Message object with the message.channels channels installed on Channel.channels, and if you pass this message to the publish method, it will send all your clients.
, , (socket.io? , Juggernaut socket.io?), .
, , , , , , , , : (https://github.com/maccman/juggernaut/blob/master/lib/juggernaut/server.js) init(), , , 30 ,