File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ "use strict" ;
2+
3+ export class Commands {
4+ public static ExitCommandBytes : Buffer = new Buffer ( "exit" ) ;
5+ public static PingBytes : Buffer = new Buffer ( "ping" ) ;
6+ public static ListKernelSpecsBytes : Buffer = new Buffer ( "lsks" ) ;
7+ public static StartKernelBytes : Buffer = new Buffer ( "strk" ) ;
8+ public static ShutdownKernelBytes : Buffer = new Buffer ( "stpk" ) ;
9+ public static RestartKernelBytes : Buffer = new Buffer ( "rstk" ) ;
10+ public static InterruptKernelBytes : Buffer = new Buffer ( "itpk" ) ;
11+ public static RunCodeBytes : Buffer = new Buffer ( "run " ) ;
12+ }
13+
14+ export namespace ResponseCommands {
15+ export const Pong = 'PONG' ;
16+ export const ListKernelsSpecs = 'LSKS' ;
17+ export const Error = 'EROR' ;
18+ export const KernelStarted = 'STRK' ;
19+ export const KernelShutdown = 'STPK' ;
20+ export const KernelRestarted = 'RSTK' ;
21+ export const KernelInterrupted = 'ITPK' ;
22+ export const RunCode = 'RUN ' ;
23+ export const ShellResult = 'SHEL' ;
24+ export const IOPUBMessage = 'IOPB' ;
25+ }
Original file line number Diff line number Diff line change 1+ "use strict" ;
2+
3+ import { KernelspecMetadata , Kernelspec , ParsedIOMessage } from '../contracts' ;
4+ import * as Rx from 'rx' ;
5+
6+ export interface IJupyterClientAdapter {
7+ getAllKernelSpecs ( ) : Promise < { [ key : string ] : Kernelspec } > ;
8+ startKernel ( kernelSpec : KernelspecMetadata ) : Promise < [ string , any , string ] > ;
9+ shutdownkernel ( kernelUUID : string ) : Promise < any > ;
10+ interruptKernel ( kernelUUID : string ) : Promise < any > ;
11+ restartKernel ( kernelUUID : string ) : Promise < any > ;
12+ runCode ( code : string ) : Rx . IObservable < ParsedIOMessage > ;
13+ on ( event : string | symbol , listener : Function ) : this;
14+ }
15+
16+ export enum KernelCommand {
17+ shutdown , restart , interrupt
18+ }
You can’t perform that action at this time.
0 commit comments