sendEvent() { let list = this.registry.list({ includes: this.opts.includes, excludes: this.opts.excludes, }); if (this.opts.onlyChanges) list = list.filter(metric => this.lastChanges.has(metric.name)); if (list.length == 0) return; process.send({ event: "metrics", list }); this.lastChanges.clear(); }
process.on("message", msg => { msg = JSON.parse(msg); si[msg.type](msg.arg).then(res => { process.send(JSON.stringify({ id: msg.id, res })); }); });
bundle( process.argv[2], process.argv[3], process.argv[3], process.argv[4], true ).then(bundler => { function cleanProcess(method) { process.exit(); } process.on("exit", cleanProcess.bind(this, "exit")); process.on("SIGTERM", cleanProcess.bind(this, "SIGTERM")); process.send("ok"); });
static isWorker() { return process.send && require.main.filename === require.resolve("./child"); }
// Respond to master's requests for worker's local metrics. process.on('message', message => { if (cluster().isWorker && message.type === GET_METRICS_REQ) { Promise.all(registries.map(r => r.getMetricsAsJSON())) .then(metrics => { process.send({ type: GET_METRICS_RES, requestId: message.requestId, metrics, }); }) .catch(error => { process.send({ type: GET_METRICS_RES, requestId: message.requestId, error: error.message, }); }); } });
bundler(process.argv[3], process.argv[5], process.argv[2]).then( bundleInfo => { process.send(JSON.stringify(bundleInfo)); } );
activity.tts.on('end', (arg1, arg2) => { process.send({ type: 'test', namespace: 'tts', event: 'end', args: [arg1, arg2] }) })
activity.on('test-get', (key) => { process.send({ type: 'test', event: 'get', result: activity[key], typeof: typeof activity[key] }) })
process.on("message", msg => { msg = JSON.parse(msg); si[msg.type](msg.arg).then(res => { process.send(JSON.stringify({ id: msg.id, res })); }); });
bundle( process.argv[2], process.argv[3], process.argv[3], process.argv[4], true ).then(bundler => { function cleanProcess(method) { process.exit(); } process.on("exit", cleanProcess.bind(this, "exit")); process.on("SIGTERM", cleanProcess.bind(this, "SIGTERM")); process.send("ok"); });
bundle( process.argv[2], process.argv[3], process.argv[3], process.argv[4], true ).then(bundler => { function cleanProcess(method) { process.exit(); } process.on("exit", cleanProcess.bind(this, "exit")); process.on("SIGTERM", cleanProcess.bind(this, "SIGTERM")); process.send("ok"); });
static isWorker() { return process.send && require.main.filename === require.resolve("./child"); }
bundle( process.argv[2], process.argv[3], process.argv[3], process.argv[4], true ).then(bundler => { function cleanProcess(method) { process.exit(); } process.on("exit", cleanProcess.bind(this, "exit")); process.on("SIGTERM", cleanProcess.bind(this, "SIGTERM")); process.send("ok"); });
activity.on('request', (nlp, action) => { process.send({ type: 'test', event: 'request', args: [nlp, action] }) })