Sha256: c63edec0423e8d4516cd0a1f5f4385638c3af21c02d76e42b31c04c154cda7c5
Contents?: true
Size: 1 KB
Versions: 13
Compression:
Stored size: 1 KB
Contents
var PubnubBus = Class.extend({ init: function(config){ debug_logger.log("initializing pubnub js") this.pubnub = PUBNUB.init({ publish_key : config.publish_key, subscribe_key : config.subscribe_key, ssl : config.ssl }); }, subscribe: function(subscription){ debug_logger.log("subscribing with PubnubBus") debug_logger.log(subscription) this.pubnub.subscribe({ channel : subscription.channel, restore : true, disconnect : function(){foreign_office.disconnection(); debug_logger.log('Lost connection to: '); debug_logger.log(subscription.channel)}, reconnect : function(){foreign_office.reconnection(); debug_logger.log('Reestablished connection to: '); debug_logger.log(subscription.channel)}, connect : function(){foreign_office.connect(); debug_logger.log("Connected to: "); debug_logger.log(subscription.channel)}, message : function(m,env,channel){subscription.callback(m)} }); } }) PubnubBus.third_party_library = 'PUBNUB'
Version data entries
13 entries across 13 versions & 1 rubygems