Node.js, Socket.io, Redis pub/sub high volume, low latency difficulties

I thought this was a reasonable question and had researched it briefly a while back. I spent a little time searching for examples that you may be able to pick up some helpful tips from. Examples I like to begin with straight forward examples: light im sample code Node.js + Redis Pub/Sub + socket.io demo … Read more

How to unsubscribe from a socket.io subscription?

From looking at the source of socket.io.js (couldn’t find it in documentation anywhere), I found these two functions: removeListener = function(name, fn) removeAllListeners = function(name) I used removeAllListeners successfully in my app; you should be able to choose from these: socket.removeListener(“news”, cbProxy); socket.removeAllListeners(“news”); Also, I don’t think your solution of cbProxy = _blank would actually … Read more

Understanding Meteor Publish / Subscribe

Collections, publications and subscriptions are a tricky area of Meteor, that the documentation could discuss in more detail, so as to avoid frequent confusion, which sometimes get amplified by confusing terminology. Here’s Sacha Greif (co-author of DiscoverMeteor) explaining publications and subscriptions in one slide: To properly understand why you need to call find() more than … Read more

Faye vs. Socket.IO (and Juggernaut)

Disclosure: I am the author of Faye. Regarding Faye, everything you’ve said is true. Faye implements most of Bayeux, the only thing missing right now is service channels, which I’ve yet to be convinced of the usefulness of. In particular Faye is designed to be compatible with the CometD reference implementation of Bayeux, which has … Read more

Why would one use the Publish/Subscribe pattern (in JS/jQuery)?

It’s all about loose coupling and single responsibility, which goes hand to hand with MV* (MVC/MVP/MVVM) patterns in JavaScript which are very modern in the last few years. Loose coupling is an Object-oriented principle in which each component of the system knows its responsibility and doesn’t care about the other components (or at least tries … Read more

Difference between Observer, Pub/Sub, and Data Binding

There are two major differences between Observer/Observable and Publisher/Subscriber patterns: Observer/Observable pattern is mostly implemented in a synchronous way, i.e. the observable calls the appropriate method of all its observers when some event occurs. The Publisher/Subscriber pattern is mostly implemented in an asynchronous way (using message queue). In the Observer/Observable pattern, the observers are aware … Read more