Merge pull request #3121 from magma1447/dev

SPLIT Join node - support for msg.resetTimeout …
This commit is contained in:
Nick O'Leary 2021-09-30 10:45:42 +01:00 committed by GitHub
commit 5df0dae11a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -631,6 +631,19 @@ module.exports = function(RED) {
}
}
if (msg.hasOwnProperty("restartTimeout")) {
if (inflight[partId]) {
if (inflight[partId].timeout) {
clearTimeout(inflight[partId].timeout);
}
if (node.timer > 0) {
inflight[partId].timeout = setTimeout(function() {
completeSend(partId)
}, node.timer)
}
}
}
if (msg.hasOwnProperty("reset")) {
if (inflight[partId]) {
if (inflight[partId].timeout) {

View File

@ -115,7 +115,7 @@
<p>A <i>count</i> can be set for how many messages should be received before generating the output 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>
<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. This timeout can be restarted and set to its initial value by sending a message with the <code>msg.restartTimeout</code> property set.</p>
<p>If a message is received with the <code>msg.complete</code> property set, the output message is finalised and sent.
This resets any part counts.</p>
<p>If a message is received with the <code>msg.reset</code> property set, the partly complete message is deleted and not sent.