Interface NotebookCellExecution

A NotebookCellExecution is how notebook controller modify a notebook cell as it is executing.

When a cell execution object is created, the cell enters the Pending state. When start(...) is called on the execution task, it enters the Executing state. When end(...) is called, it enters the Idle state.

interface NotebookCellExecution {
    cell: NotebookCell;
    executionOrder: undefined | number;
    token: CancellationToken;
    appendOutput(out, cell?): Thenable<void>;
    appendOutputItems(items, output): Thenable<void>;
    clearOutput(cell?): Thenable<void>;
    end(success, endTime?): void;
    replaceOutput(out, cell?): Thenable<void>;
    replaceOutputItems(items, output): Thenable<void>;
    start(startTime?): void;
}

Properties

The cell for which this execution has been created.

executionOrder: undefined | number

Set and unset the order of this cell execution.

A cancellation token which will be triggered when the cell execution is canceled from the UI.

Note that the cancellation token will not be triggered when the controller that created this execution uses an interrupt-handler.

Methods

  • Clears the output of the cell that is executing or of another cell that is affected by this execution.

    Parameters

    • Optional cell: NotebookCell

      Cell for which output is cleared. Defaults to the cell of this execution.

    Returns Thenable<void>

    A thenable that resolves when the operation finished.

  • Signal that execution has ended.

    Parameters

    • success: undefined | boolean

      If true, a green check is shown on the cell status bar. If false, a red X is shown. If undefined, no check or X icon is shown.

    • Optional endTime: number

      The time that execution finished, in milliseconds in the Unix epoch.

    Returns void

  • Signal that the execution has begun.

    Parameters

    • Optional startTime: number

      The time that execution began, in milliseconds in the Unix epoch. Used to drive the clock that shows for how long a cell has been running. If not given, the clock won't be shown.

    Returns void