Pass every nth message

#1

Hi,

Is there a node which can Pass every nth message?
Pass msg, drop N-1 messages, Pass msg, drop N-1 messages, etc...

I couldn't find such node...
Thank you.

0 Likes

#2

Have a look at the join node.

0 Likes

#3

Tried "join" node in different permutations for 2 hours.
I couldn't understand how to configure it to pass every nth message and drop the rest.
Any hint is appreciated :slight_smile:

Then i wrote my own function which doesn't work too... :frowning:

0 Likes

#4

Could you post a sample of your data and explain exactly what you are trying to achieve?

0 Likes

#5

Hi @igrowing,

I use always the node-red-contrib-throttle when I need such functionality : see 'by counter' option...
Bart

2 Likes

#6

If what you are actually trying to do is to limit the rate at which you receive messages, throwing away intermediate ones, the you can use a Delay node set to Rate Limit mode with Discard Intermediate Messages selected.
Alternatively if the reason you want to ignore them is because they are repeated messages then you could use an RBE node, which will ignore repeated messages, sending a message only when it gets one with different content.

2 Likes

#7

@BartButenaers, @Colin Thank you very much.
Both proposals do what I was looking for.

Since "delay" comes by default, I'll go with it.

0 Likes