Hook up shared process sorta

This commit is contained in:
Asher
2019-01-18 18:04:24 -06:00
committed by Kyle Carberry
parent d827015b40
commit 811260cc80
15 changed files with 198 additions and 246 deletions

View File

@ -25,12 +25,6 @@ export const createApp = (registerMiddleware?: (app: express.Application) => voi
};
wss.on("connection", (ws: WebSocket, req) => {
const spm = (<any>req).sharedProcessInit as SharedProcessInitMessage;
if (!spm) {
ws.close();
return;
}
const connection: ReadWriteConnection = {
onMessage: (cb): void => {
ws.addEventListener("message", (event) => cb(event.data));
@ -44,7 +38,7 @@ export const createApp = (registerMiddleware?: (app: express.Application) => voi
...options,
forkProvider: (message: NewSessionMessage): ChildProcess => {
let proc: ChildProcess;
if (message.getIsBootstrapFork()) {
proc = forkModule(message.getCommand());
} else {