Skip to content

Commit 7dc9439

Browse files
authored
Merge pull request #2731 from vidartf/comm-buffers
Add buffers argument to comm open/close
2 parents da2d54f + 9249ae2 commit 7dc9439

File tree

1 file changed

+8
-8
lines changed
  • notebook/static/services/kernels

1 file changed

+8
-8
lines changed

notebook/static/services/kernels/comm.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ define([
3030
kernel.register_iopub_handler(msg_type, $.proxy(this[msg_type], this));
3131
}
3232
};
33-
34-
CommManager.prototype.new_comm = function (target_name, data, callbacks, metadata, comm_id) {
33+
34+
CommManager.prototype.new_comm = function (target_name, data, callbacks, metadata, comm_id, buffers) {
3535
/**
3636
* Create a new Comm, register it, and open its Kernel-side counterpart
3737
* Mimics the auto-registration in `Comm.__init__` in the Jupyter Comm.
@@ -40,7 +40,7 @@ define([
4040
*/
4141
var comm = new Comm(target_name, comm_id);
4242
this.register_comm(comm);
43-
comm.open(data, callbacks, metadata);
43+
comm.open(data, callbacks, metadata, buffers);
4444
return comm;
4545
};
4646

@@ -147,13 +147,13 @@ define([
147147
};
148148

149149
// methods for sending messages
150-
Comm.prototype.open = function (data, callbacks, metadata) {
150+
Comm.prototype.open = function (data, callbacks, metadata, buffers) {
151151
var content = {
152152
comm_id : this.comm_id,
153153
target_name : this.target_name,
154154
data : data || {},
155155
};
156-
return this.kernel.send_shell_message("comm_open", content, callbacks, metadata);
156+
return this.kernel.send_shell_message("comm_open", content, callbacks, metadata, buffers);
157157
};
158158

159159
Comm.prototype.send = function (data, callbacks, metadata, buffers) {
@@ -163,13 +163,13 @@ define([
163163
};
164164
return this.kernel.send_shell_message("comm_msg", content, callbacks, metadata, buffers);
165165
};
166-
167-
Comm.prototype.close = function (data, callbacks, metadata) {
166+
167+
Comm.prototype.close = function (data, callbacks, metadata, buffers) {
168168
var content = {
169169
comm_id : this.comm_id,
170170
data : data || {},
171171
};
172-
return this.kernel.send_shell_message("comm_close", content, callbacks, metadata);
172+
return this.kernel.send_shell_message("comm_close", content, callbacks, metadata, buffers);
173173
};
174174

175175
// methods for registering callbacks for incoming messages

0 commit comments

Comments
 (0)