2026-05-10 22:23:44 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
const { BaseNodeAdapter } = require('generalFunctions');
|
|
|
|
|
const Settler = require('./specificClass');
|
|
|
|
|
const commands = require('./commands');
|
|
|
|
|
|
|
|
|
|
// settler is event-driven on Port 0: the 3-stream Fluent envelope is
|
|
|
|
|
// re-emitted whenever the upstream reactor fires stateChange or an
|
|
|
|
|
// operator pushes data.influent. Port 1 (InfluxDB telemetry) reuses the
|
|
|
|
|
// base `output-changed` pipeline via `getOutput()`. `tickInterval=null`
|
|
|
|
|
// means BaseNodeAdapter installs no periodic loop — settling state has
|
|
|
|
|
// no time-dependent integrator.
|
|
|
|
|
class nodeClass extends BaseNodeAdapter {
|
|
|
|
|
static DomainClass = Settler;
|
|
|
|
|
static commands = commands;
|
|
|
|
|
static tickInterval = null;
|
|
|
|
|
static statusInterval = 1000;
|
|
|
|
|
|
|
|
|
|
buildDomainConfig() {
|
|
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_emitOutputs() {
|
|
|
|
|
if (!this.source) return;
|
|
|
|
|
const fluent = this.source.getEffluent;
|
|
|
|
|
const raw = this.source.getOutput?.() || {};
|
|
|
|
|
const cfg = this.source.config || this.config;
|
|
|
|
|
const influxMsg = this._output.formatMsg(raw, cfg, 'influxdb');
|
|
|
|
|
this.node.send([fluent, influxMsg, null]);
|
2025-10-22 16:22:33 +02:00
|
|
|
}
|
2025-10-22 16:07:42 +02:00
|
|
|
}
|
|
|
|
|
|
2026-03-31 14:26:10 +02:00
|
|
|
module.exports = nodeClass;
|