Channels are usually used for filtering data i.e. one for /SPORT/FOOTBALL/PREMIERLEAGUE/MANU, another /SPORT/FOOTBALL/CHAMPIONSHIP/WESTHAM and /SPORT/GOLF/USMASTERS.
I only know of one realtime Comet server which offers additional filtering though subscriptions to the channels and that is Caplin System's Liberator. For example (pseudocode):
var subscriber = new Subscriber();
var filter = "headline~transfer"; // where '~' means contains
subscriber.subscribe("/SPORT/FOOTBALL/PREMIERLEAGUE/MANU", filter, function(update) {
// handle update
});
The above code would subscribe to the channel but only send updates whenever and update came in where the headline
field contained the text transfer
.
Another solution that appears to offer this querying functionality is pubsub.io. From their site:
// connect from node
var pubsub = require('pubsub.io').connect('hub.pubsub.io/238258');
// or the browser
var pubsub = pubsubio.connect('hub.pubsub.io/238258');
pubsub.subscribe({
hello:{$any:['world','mundo','verden']}
}, function(doc) {
console.log(doc);
});
pubsub.publish({hello:'world'});
This sort of channel querying may well be something we start to see more of.