src/vs/platform/sharedProcess/electron-browser/sharedProcessWorkerService.ts/SharedProcessWebWorker/send
class SharedProcessWebWorker:	private async send(message: ISharedProcessToWorkerMessage, token: CancellationToken, port?: MessagePort): Promise<void> {
		const worker = await this.workerReady;

		if (token.isCancellationRequested) {
			return;
		}

		return new Promise<void>(resolve => {

			// Store the awaiter for resolving when message
			// is received with the given nonce
			const nonce = generateUuid();
			this.mapMessageNonceToPendingMessageResolve.set(nonce, resolve);

			// Post message into worker
			const workerMessage: ISharedProcessToWorkerMessage = { ...message, nonce };
			if (port) {
				worker.postMessage(workerMessage, [port]);
			} else {
				worker.postMessage(workerMessage);
			}

			// Release on cancellation if still pending
			token.onCancellationRequested(() => {
				if (this.mapMessageNonceToPendingMessageResolve.delete(nonce)) {
					resolve();
				}
			});
		});
	}