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

Version Path
foreign_office-0.12.0 app/assets/javascripts/pubnub_bus.js
foreign_office-0.11.0 app/assets/javascripts/pubnub_bus.js
foreign_office-0.10.3 app/assets/javascripts/pubnub_bus.js
foreign_office-0.10.2 app/assets/javascripts/pubnub_bus.js
foreign_office-0.10.1 app/assets/javascripts/pubnub_bus.js
foreign_office-0.10.0 app/assets/javascripts/pubnub_bus.js
foreign_office-0.9.1 app/assets/javascripts/pubnub_bus.js
foreign_office-0.9.0 app/assets/javascripts/pubnub_bus.js
foreign_office-0.8.1 app/assets/javascripts/pubnub_bus.js
foreign_office-0.8.0 app/assets/javascripts/pubnub_bus.js
foreign_office-0.7.3 app/assets/javascripts/pubnub_bus.js
foreign_office-0.7.2 app/assets/javascripts/pubnub_bus.js
foreign_office-0.7.1 app/assets/javascripts/pubnub_bus.js