After a discussion under the below thread with @cymplecy
node-red-semaphore-plus 3.1.0 is now available.
New Features
You can now reset the lock (which will dispose of all messages)
To do this, send a property of msg.smp_reset = true to the Release Node
Changes
The color and shape of the status in the Take Node, now denotes whether or not a message will be queued, where a dot denotes if this Take has queued messages, and a ring denotes that it does not.
No messages queued here, but will be if one is passed to it
No messages queued here, and a message will pass right away
Messages queued here, and further message will be queued
The release node doesn't quite follow exactly (i.e. no green ring when not going to queue next message)
Of course, I didn't read the instructions and just tried msg.reset = true - which failed of course
Worked fine when I sent correct message but AFAIK all other NR nodes that accept reset msgs just use msg.reset so I'd suggest just using that (as who has time to read instructions/documentation???)
I was in 2 minds about this one
Given Release/FS Reset won't be queuing anything, I think I customised the status shapes more for Take Nodes as their queue stats can differ from each other
Yup, was also at a cross road, as all nodes passthrough the msg and didn't want to step on other nodes toes so to speak, that also use msg.reset but then I'm portably too kind
Presently, I'll keep it as the prefixed smp_ as there are a few other magic properties that can control behaviour like setting the fail-safe timeout in a message.. example: smp_failsafeTimeout
I think the unwritten rule of the other nodes is that if a msg.reset is received, they clear their internal state and don't output anything so no propagation occurs
msg.reset - Reset state and don't forward the msg to adhere to the 'norm' msg.smp_reset - Reset state only
Explanation:
The Semaphore Release Node can also be used to reset the entire queue state, this will result in all queued message being dropped.
Setting a message property smp_reset = true will achieve this. If you wanted to stop the message containing this command from propagating, use reset instead of smp_reset
The LFS status shows what the current LFS is, as it can change during flow activity (or more accurately, when a message has passed through) it’s at that time, the FS is actually applied and ticking down so to speak
I.e once a message is allowed through, it shows what LFS is currently applied
The FS that is set on the node, is the default that will be applied, when a message passes through, unless you override it of course with the magic property.
As the FS is global, I think what I am aiming to show is what the current / active LFS (last) is.
What I can show is another value perhaps, what the default is (as set in the node properties) , as well as the current FS that is currently enforced.
LQ - Local Queue Size GQ - Global Queue Size DFS - Default Fail-Safe (for this Take or Reset node) - i.e what is set on the Node it's self LAFS - Last Active Fail-Safe
I am not using the node label currently, but may do in the future.
I am now using vertical bars to separate the stats, I think its much clearer when reading.
thoughts?
EDIT:
The node setting label has also been updated
Both the Take and FS Reset Nodes, now includes a new output property. smp_appliedFailsafe This denotes what fail-safe was applied for this msg allowing reference to the current fail-safe time.
You can, for example, use its value to decide on an updated fail-safe time, for the current message