I'm looking for a different rate limiter and wonder if anyone has already built it.
The default rate limiter seems to delay the first message by the limit rate. I want the first message after deployment to be sent, and then rate limit subsequent messages.
What I want is one that works like this when a message is received:
- If no message has been sent, send the message and log the time as last_time;
- If a message has previously been sent, and (current_time - last_time) < delay, drop the message;
- If a message has previously been sent, and (current_time - last_time) >= delay, send the message and log the time as last_time
The key difference here is that the first message isn't delayed at all.
Has anyone done this? I can think of ways to do it, but if someone else has a tried-and-tested node for this I'd rather use that.
Thanks!