Skip to content

Instantly share code, notes, and snippets.

@sccolbert
sccolbert / kernelfuture.ts
Last active September 15, 2015 19:55 — forked from blink1073/kernelfuture.ts
KernelFuture
function createFuture(kernel: IKernel, msgId: string, shellPromise: Promise<IKernelMessage>): IKernelFuture {
var future = new KernelFutureHandler(msgId);
kernel.iopubReceived.connect(future.handleIOPub, future);
kernel.stdinReceived.connect(future.handlerStdin, future);
shellPromise.then(msg => future.handleReply(kernel, msg));
return future;
}