scttnlsn/backbone.io — Issue #6: Channels/rooms support
Author: podviaznikov
Created: 2012-02-28 21:17:54+00:00
State: open

I have following case:
I want models synchronized not between all clients but between few selected ones.

I did following changes in the library:
browsers.js

>>buildBackedn method

backend.socket.on('connect', function () {
backend.socket.emit('set channel', 'SOME_CHANNEL_ID');
});

index.js

>> on 'connection' listener

socket.on('set channel', function(channel) {
socket.join(channel);
});

>> on 'sync' listener

socket.get('channel', function (err, channel) {
socket.broadcast.to(channel).emit('synced', req.method, result);
});

It works for me. However I have 2 questions:
1. Is there is another way to achieve following functionality?
2. Can we add some optional support for such functionality inside the library?