Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
send(
data: any,
callbacks: any,
metadata?: any,
buffers?: ArrayBuffer[] | ArrayBufferView[]
): string {
const message = createCommMessage(
this.comm_id,
data,
this.flattenBufferArrays(buffers)
);
const callbackAction$ = this.kernel.channels.pipe(
childOf(message),
outputs() as any,
map((output: any) => this.actions.appendOutput(output))
);
Observable.create((observer: Observer) => {
const subscription = callbackAction$.subscribe(observer);
this.kernel.channels.next(message);
return subscription;
}).subscribe(console.log, console.error, console.log);
open(
data: any,
callbacks: any,
metadata?: any,
buffers?: ArrayBuffer[] | ArrayBufferView[]
): string {
const message = createCommOpenMessage(
this.comm_id,
this.target_name,
this.flattenBufferArrays(buffers),
this.target_module
);
this.kernel.channels.next(message);
return message.header.msg_id;
}