chore(rpc): exit server upon pipe disconnect (#2836)

This commit is contained in:
Pavel Feldman 2020-07-04 09:52:38 -07:00 committed by GitHub
parent 2540805bf2
commit 241d39f904
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,6 +29,7 @@ export class Transport {
constructor(pipeWrite: NodeJS.WritableStream, pipeRead: NodeJS.ReadableStream) {
this._pipeWrite = pipeWrite;
pipeRead.on('data', buffer => this._dispatch(buffer));
pipeRead.on('close', () => process.exit(0));
this.onmessage = undefined;
this.onclose = undefined;
}