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) {