shell should wait for shared process to be up and running

This commit is contained in:
Joao Moreno
2017-03-07 16:59:09 +01:00
parent 216460af69
commit a39a0f2e18
7 changed files with 27 additions and 8 deletions

View File

@@ -143,7 +143,7 @@ function main(accessor: ServicesAccessor, mainIpcServer: Server, userEnv: platfo
// Spawn shared process
const sharedProcess = new SharedProcess(environmentService, userEnv);
const sharedProcessClient = sharedProcess.onReady
const sharedProcessClient = sharedProcess.whenReady()
.then(() => connect(environmentService.sharedIPCHandle, 'main'));
// Create a new service collection, because the telemetry service

View File

@@ -17,7 +17,7 @@ export class SharedProcess {
private disposables: IDisposable[] = [];
@memoize
get onReady(): TPromise<void> {
private get _whenReady(): TPromise<void> {
this.window = new BrowserWindow({ show: false });
const config = assign({
appRoot: this.environmentService.appRoot,
@@ -59,7 +59,7 @@ export class SharedProcess {
args: this.environmentService.args
});
sender.once('handshake:im ready', () => c(null));
ipcMain.once('handshake:im ready', () => c(null));
});
});
}
@@ -69,6 +69,10 @@ export class SharedProcess {
private userEnv: IProcessEnvironment
) { }
whenReady(): TPromise<void> {
return this._whenReady;
}
toggle(): void {
if (this.window.isVisible()) {
this.hide();