Browse Source

Fix IPC client services not waiting for connection upon boot

dev
David Ludwig 4 years ago
parent
commit
ec0391c2ee
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      packages/ipc/src/IpcClientService.ts

+ 4
- 4
packages/ipc/src/IpcClientService.ts View File

@ -40,14 +40,14 @@ export abstract class IpcClientService<M extends Microservice = Microservice> ex
*/
public bootIpc(ipc: IPC) {
// Connect to the server
return new Promise<void>((resolve, reject) => {
return new Promise<void>((resolve, _) => {
this.rawIpcInstance!.connectTo(this.NAME, this.SOCKET_PATH, () => {
this.__isConnected = true;
this.__isConnected = false;
this.__requestId = 0;
this.__socket = ipc!.of[this.NAME];
this.__socket = <Socket>ipc!.of[this.NAME];
this.installEventHandlers(this.__socket!);
this.installMessageHandlers();
resolve();
this.__socket!.once("connect", resolve);
});
});
}


Loading…
Cancel
Save