Datalayer Desktop - v0.0.2
    Preparing search index...

    Runtime service interface. Manages compute runtime lifecycle for notebooks.

    interface IRuntimeService {
        state: ServiceState;
        createRuntime(
            notebookId: string,
            notebookPath?: string,
            options?: RuntimeOptions,
        ): Promise<RuntimeJSON>;
        dispose(): Promise<void>;
        getRuntimeForNotebook(notebookId: string): null | RuntimeJSON;
        getServiceManager(notebookId: string): null | IManager;
        initialize(): Promise<void>;
        listAllRuntimes(): Promise<RuntimeJSON[]>;
        notifyRuntimeTerminated(podName: string): void;
        onRuntimeExpired(callback: (podName: string) => void): () => void;
        onRuntimeListRefreshed(
            callback: (runtimes: RuntimeJSON[]) => void,
        ): () => void;
        onRuntimeStateChanged(
            callback: (change: RuntimeStateChange) => void,
        ): () => void;
        refreshAllRuntimes(): Promise<RuntimeJSON[]>;
        setServiceManager(notebookId: string, manager: IManager): void;
        terminateRuntime(notebookId: string): Promise<void>;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    Current state of the service.

    Methods

    • Manually notify all subscribers that a runtime has been terminated. This propagates the termination to ALL editors connected to that runtime.

      Parameters

      • podName: string

        The pod name of the terminated runtime

      Returns void

    • Subscribe to global runtime expiration events. Called when ANY runtime on the platform expires.

      Parameters

      • callback: (podName: string) => void

        Function to call with the expired runtime's podName

      Returns () => void

      Unsubscribe function

    • Subscribe to runtime list refresh events. Called when the list of all runtimes has been updated.

      Parameters

      • callback: (runtimes: RuntimeJSON[]) => void

        Function to call with the updated runtime list

      Returns () => void

      Unsubscribe function