# Dynamic rate delay with a buffer

**URL:** <https://discourse.nodered.org/t/dynamic-rate-delay-with-a-buffer/47761>\
**Category:** General\
**Created:** [28 June 2021 20:59 UTC](https://discourse.nodered.org/t/dynamic-rate-delay-with-a-buffer/47761 "2021-06-28T20:59:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![injector22](https://avatars.discourse-cdn.com/v4/letter/i/e9bcb4/32.png) [@injector22](https://discourse.nodered.org/u/injector22)\
**Post date:** [28 June 2021 20:59 UTC](https://discourse.nodered.org/t/dynamic-rate-delay-with-a-buffer/47761/1 "2021-06-28T20:59:11Z")

</div>

I've been reading the few threads there is regarding the delay node but I can't seem to find what I'm looking for.

I have a set of messages that comes into a flow and what I'm trying to do is a blocking delay. Essentially the messages that come in would look like this:

command1  
command2  
command3  
sleep 5000  
command6  
sleep 2000  
command7  
command8

With the message above, command1 and 2 would be passed without delays, then a blocking delay of 5 seconds would hold back command 6-8, then after 5 seconds, command6 is released, then another hold of 2 seconds before commands 7 and 8 are sent.

The issue I'm having is with Nodes async nature if I block one message the others still continue through.

I tried using a delay node and setting the msg.delay topic but the messages are still passing through without a delay.

Anyone have any ideas?

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [29 June 2021 00:34 UTC](https://discourse.nodered.org/t/dynamic-rate-delay-with-a-buffer/47761/2 "2021-06-29T00:34:08Z")

</div>

i think you could achieve what you want with

> **[node-red-contrib-queue-gate](https://flows.nodered.org/node/node-red-contrib-queue-gate)**
>
> A gate node (with queueing) for node-RED

Craig

---

<div class="post-metadata">

**Author:** ![injector22](https://avatars.discourse-cdn.com/v4/letter/i/e9bcb4/32.png) [@injector22](https://discourse.nodered.org/u/injector22)\
**Post date:** [1 July 2021 23:54 UTC](https://discourse.nodered.org/t/dynamic-rate-delay-with-a-buffer/47761/3 "2021-07-01T23:54:15Z")

</div>

Thank you, that's exactly what I needed. I added a delay node along with a dual output function node and now I can add custom blocking delays.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [15 July 2021 23:54 UTC](https://discourse.nodered.org/t/dynamic-rate-delay-with-a-buffer/47761/4 "2021-07-15T23:54:18Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
