Remove message promise.

Jonathan Frederic 12 years ago committed by Jonathan Frederic
parent fe398593e7
commit 3c949aad92

@ -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) {

@ -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));

Loading…
Cancel
Save