src/vs/platform/sharedProcess/electron-browser/sharedProcessWorkerMain.ts/SharedProcessWorkerMain/onMessage
class SharedProcessWorkerMain:	onMessage(message: ISharedProcessToWorkerMessage, transfer?: Transferable[]): void {

		// Handle message from shared process
		switch (message.id) {

			// Spawn new process
			case SharedProcessWorkerMessages.Spawn:
				if (transfer && transfer[0] instanceof MessagePort && message.environment) {
					this.spawn(transfer[0], message.configuration, message.environment);
				}
				break;

			// Terminate existing process
			case SharedProcessWorkerMessages.Terminate:
				this.terminate(message.configuration);
				break;

			default:
				Logger.warn(`Unexpected shared process message '${message}'`);
		}

		// Acknowledge message processed if we have a nonce
		if (message.nonce) {
			send({
				id: SharedProcessWorkerMessages.Ack,
				nonce: message.nonce
			});
		}
	}