From 924309ea8e4bfca8c750b6c6c1dd6e84fb7c041d Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Sun, 19 May 2019 22:23:17 +0200 Subject: [PATCH] fix(core): update --- ts/index.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ts/index.ts b/ts/index.ts index ea48bd0..1984e49 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -2,10 +2,22 @@ import * as plugins from './smartexit.plugins'; export class SmartExit { public processesToEnd = new plugins.lik.Objectmap(); - public async addProcess(childProcessArg: plugins.childProcess.ChildProcess) { + + /** + * adds a process to be exited + * @param childProcessArg + */ + public addProcess(childProcessArg: plugins.childProcess.ChildProcess) { this.processesToEnd.add(childProcessArg); } + /** + * removes a process to be exited + */ + public removeProcess(childProcessArg: plugins.childProcess.ChildProcess) { + this.processesToEnd.remove(childProcessArg); + } + public async killAll() { console.log('Checking for remaining child processes before exit...'); if (this.processesToEnd.getArray().length > 0) {