Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/editor/common/services/editorWorkerHost.ts
3295 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { IWebWorkerServer, IWebWorkerClient } from '../../../base/common/worker/webWorker.js';
7
8
export abstract class EditorWorkerHost {
9
public static CHANNEL_NAME = 'editorWorkerHost';
10
public static getChannel(workerServer: IWebWorkerServer): EditorWorkerHost {
11
return workerServer.getChannel<EditorWorkerHost>(EditorWorkerHost.CHANNEL_NAME);
12
}
13
public static setChannel(workerClient: IWebWorkerClient<any>, obj: EditorWorkerHost): void {
14
workerClient.setChannel<EditorWorkerHost>(EditorWorkerHost.CHANNEL_NAME, obj);
15
}
16
17
// foreign host request
18
abstract $fhr(method: string, args: any[]): Promise<any>;
19
}
20
21