@emartech/faye-redis-sharded
Version:
Redis backend engine for Faye with support for sharding
22 lines (18 loc) • 539 B
JavaScript
Faye.Subscription = Faye.Class({
initialize: function(client, channels, callback, context) {
this._client = client;
this._channels = channels;
this._callback = callback;
this._context = context;
this._cancelled = false;
},
cancel: function() {
if (this._cancelled) return;
this._client.unsubscribe(this._channels, this._callback, this._context);
this._cancelled = true;
},
unsubscribe: function() {
this.cancel();
}
});
Faye.extend(Faye.Subscription.prototype, Faye.Deferrable);