Improve NotebookExecutionService and cancel executions when closing the notebook, deleting cells, and changing the kernel

This commit is contained in:
Rob Lourens
2021-11-29 14:00:53 -08:00
parent f0ee64fa7f
commit 33d81fdc8c
9 changed files with 365 additions and 200 deletions

View File

@@ -922,7 +922,7 @@ export interface INotebookKernelDto2 {
export interface ICellExecuteOutputEditDto {
editType: CellExecutionUpdateType.Output;
executionHandle: number;
uri: UriComponents;
cellHandle: number;
append?: boolean;
outputs: NotebookOutputDto[]
@@ -930,21 +930,24 @@ export interface ICellExecuteOutputEditDto {
export interface ICellExecuteOutputItemEditDto {
editType: CellExecutionUpdateType.OutputItems;
executionHandle: number;
uri: UriComponents;
cellHandle: number;
append?: boolean;
outputId: string;
items: NotebookOutputItemDto[]
}
export interface ICellExecutionStateUpdateDto extends ICellExecutionStateUpdate {
executionHandle: number;
uri: UriComponents;
cellHandle: number;
}
export interface ICellExecutionCompleteDto extends ICellExecutionComplete {
executionHandle: number;
uri: UriComponents;
cellHandle: number;
}
export type ICellExecuteUpdateDto = ICellExecuteOutputEditDto | ICellExecuteOutputItemEditDto | ICellExecutionStateUpdateDto | ICellExecutionCompleteDto;
export type ICellExecuteUpdateDto = ICellExecuteOutputEditDto | ICellExecuteOutputItemEditDto | ICellExecutionStateUpdateDto;
export interface MainThreadNotebookKernelsShape extends IDisposable {
$postMessage(handle: number, editorId: string | undefined, message: any): Promise<boolean>;
@@ -953,9 +956,9 @@ export interface MainThreadNotebookKernelsShape extends IDisposable {
$removeKernel(handle: number): void;
$updateNotebookPriority(handle: number, uri: UriComponents, value: number | undefined): void;
$addExecution(handle: number, uri: UriComponents, cellHandle: number): void;
$addExecution(uri: UriComponents, cellHandle: number): void;
$updateExecutions(data: SerializableObjectWithBuffers<ICellExecuteUpdateDto[]>): void;
$removeExecution(handle: number): void;
$completeExecution(uri: UriComponents, cellHandle: number, data: SerializableObjectWithBuffers<ICellExecutionCompleteDto>): void;
}
export interface MainThreadNotebookRenderersShape extends IDisposable {