mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Split node - fix complete to send msg for k/v object
and update info to try to clarify.
This commit is contained in:
parent
7703875740
commit
72b8dbb45b
@ -295,7 +295,8 @@
|
|||||||
For object outputs, once this count has been reached, the node can be configured to send a message for each subsequent message
|
For object outputs, once this count has been reached, the node can be configured to send a message for each subsequent message
|
||||||
received.</p>
|
received.</p>
|
||||||
<p>A <i>timeout</i> can be set to trigger sending the new message using whatever has been received so far.</p>
|
<p>A <i>timeout</i> can be set to trigger sending the new message using whatever has been received so far.</p>
|
||||||
<p>If a message is received with the <b>msg.complete</b> property set, the output message is sent.</p>
|
<p>If a message is received with the <b>msg.complete</b> property set, the output message is finalised and sent.
|
||||||
|
This resets any part counts.</p>
|
||||||
|
|
||||||
<h4>Reduce Sequence mode</h4>
|
<h4>Reduce Sequence mode</h4>
|
||||||
<p>When configured to join in reduce mode, an expression is applied to each
|
<p>When configured to join in reduce mode, an expression is applied to each
|
||||||
|
@ -586,7 +586,10 @@ module.exports = function(RED) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (msg.hasOwnProperty('complete')) {
|
if (msg.hasOwnProperty('complete')) {
|
||||||
completeSend(partId);
|
if (inflight[partId]) {
|
||||||
|
inflight[partId].msg.complete = msg.complete;
|
||||||
|
completeSend(partId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
node.warn("Message missing key property 'msg."+node.key+"' - cannot add to object")
|
node.warn("Message missing key property 'msg."+node.key+"' - cannot add to object")
|
||||||
@ -594,6 +597,7 @@ module.exports = function(RED) {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!inflight.hasOwnProperty(partId)) {
|
if (!inflight.hasOwnProperty(partId)) {
|
||||||
if (payloadType === 'object' || payloadType === 'merged') {
|
if (payloadType === 'object' || payloadType === 'merged') {
|
||||||
inflight[partId] = {
|
inflight[partId] = {
|
||||||
@ -604,19 +608,6 @@ module.exports = function(RED) {
|
|||||||
msg:RED.util.cloneMessage(msg)
|
msg:RED.util.cloneMessage(msg)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else if (node.accumulate === true) {
|
|
||||||
if (msg.hasOwnProperty("reset")) { delete inflight[partId]; }
|
|
||||||
inflight[partId] = inflight[partId] || {
|
|
||||||
currentCount:0,
|
|
||||||
payload:{},
|
|
||||||
targetCount:targetCount,
|
|
||||||
type:payloadType,
|
|
||||||
msg:RED.util.cloneMessage(msg)
|
|
||||||
}
|
|
||||||
if (payloadType === 'string' || payloadType === 'array' || payloadType === 'buffer') {
|
|
||||||
inflight[partId].payload = [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
inflight[partId] = {
|
inflight[partId] = {
|
||||||
currentCount:0,
|
currentCount:0,
|
||||||
|
Loading…
Reference in New Issue
Block a user