From d0f2a25104ff006c3b4a9aff24dd7ffca0e5b750 2014-11-15 16:49:45 From: Jonathan Frederic Date: 2014-11-15 16:49:45 Subject: [PATCH] Remove message promise. --- diff --git a/IPython/html/static/services/kernels/comm.js b/IPython/html/static/services/kernels/comm.js index 156e10b..d254c94 100644 --- a/IPython/html/static/services/kernels/comm.js +++ b/IPython/html/static/services/kernels/comm.js @@ -131,11 +131,6 @@ define([ this.target_name = target_name; this.comm_id = comm_id || utils.uuid(); this._msg_callback = this._close_callback = null; - - var that = this; - this.msg_promise = new Promise(function(resolve, reject) { - that.resolve_msg_promise = resolve; - }); }; // methods for sending messages @@ -171,7 +166,6 @@ define([ Comm.prototype.on_msg = function (callback) { this._register_callback('msg', callback); - this.resolve_msg_promise(); }; Comm.prototype.on_close = function (callback) { @@ -192,11 +186,7 @@ define([ }; Comm.prototype.handle_msg = function (msg) { - var that = this; - this.msg_promise = this.msg_promise.then(function() { - that._maybe_callback('msg', msg); - return Promise.resolve(); - }); + that._maybe_callback('msg', msg); }; Comm.prototype.handle_close = function (msg) { diff --git a/IPython/html/static/widgets/js/manager.js b/IPython/html/static/widgets/js/manager.js index 7cd73dc..31252ac 100644 --- a/IPython/html/static/widgets/js/manager.js +++ b/IPython/html/static/widgets/js/manager.js @@ -183,7 +183,7 @@ define([ WidgetManager.prototype._handle_comm_open = function (comm, msg) { // Handle when a comm is opened. - this.create_model({ + return this.create_model({ model_name: msg.content.data.model_name, model_module: msg.content.data.model_module, comm: comm}).catch($.proxy(console.error, console));