Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
startKernel: async (parentValue: any, args: StartKernel) => {
const kernel = await launchKernel(args.name);
console.log(`kernel ${args.name}:${kernel.connectionInfo.key} launched`);
// NOTE: we should generate IDs
// We're also setting a session ID within the enchannel-zmq setup, I wonder
// if we should use that
const id = kernel.connectionInfo.key;
messages[id] = [];
kernels[id] = kernel;
const subscription = kernel.channels.subscribe(
(message: JupyterMessage) => {
messages[id].push(message);
}
);
startKernel: async (parentValue: any, args: StartKernel) => {
const kernel = await launchKernel(args.name);
console.log(`kernel ${args.name}:${kernel.connectionInfo.key} launched`);
// NOTE: we should generate IDs
// We're also setting a session ID within the enchannel-zmq setup, I wonder
// if we should use that
const id = kernel.connectionInfo.key;
messages[id] = [];
kernels[id] = kernel;
const subscription = kernel.channels.subscribe(
(message: JupyterMessage) => {
messages[id].push(message);
}
);
startKernel: async (_parentValue: any, args: StartKernel) => {
const kernel = await launchKernel(args.name);
kernels[kernel.connectionInfo.key] = kernel;
return {
id: kernel.connectionInfo.key,
status: "launched"
};
},
shutdownKernel: async (_parentValue: any, args: { id: string }) => {