stop() { emotivProcess.removeAllListeners(); }
async function runConfig(configPath, env) { const child = child_process.fork( path.join(__dirname, 'config-runner.js'), [configPath], { stdio: 'inherit', env } ); try { return await new Promise( configProcessMessageHandler.bind(child, configPath)); } catch (ex) { throw ex; } finally { child.removeAllListeners(); } }
/** * Close the Worker. */ close() { logger.debug('close()'); if (this._closed) return; this._closed = true; // Kill the worker process. if (this._child) { // Remove event listeners but leave a fake 'error' hander to avoid // propagation. if (PYTHON_LOG_VIA_PIPE) { this._child.stdout.removeAllListeners(); this._child.stderr.removeAllListeners(); } this._child.removeAllListeners('exit'); this._child.removeAllListeners('error'); // eslint-disable-next-line @typescript-eslint/no-empty-function this._child.on('error', () => { }); this._child = undefined; } // Close every Handler. for (const handler of this._handlers) { handler.close(); } this._handlers.clear(); // Close the Channel instance. this._channel.close(); }
forked.removeAllListeners(); forked.kill(); return;
this._child.stdout.removeAllListeners(); this._child.stderr.removeAllListeners(); this._child.removeAllListeners('exit'); this._child.removeAllListeners('error');