1
00:00:00,990 --> 00:00:06,300
In this lecture, I'll show you how to use a delanoe, it's a very useful note, it actually does two

2
00:00:06,300 --> 00:00:06,750
things.

3
00:00:07,290 --> 00:00:16,350
It allows you to delay a message input and output by an arbitrary amount of time, but also to limit

4
00:00:16,350 --> 00:00:22,710
the rate of messages that are passing through it, which is very useful if you want to connect your

5
00:00:22,710 --> 00:00:25,700
flow to some external resource on the cloud.

6
00:00:25,950 --> 00:00:32,310
For example, Google spreadsheet, those services typically introduce limits to how many messages they

7
00:00:32,310 --> 00:00:39,450
can receive, and if you exceed them, then you're locked out, or at least you are limited by the imposed

8
00:00:39,450 --> 00:00:40,290
rate limit.

9
00:00:40,300 --> 00:00:50,490
So you can then use the delay node to ensure that your flow does not bombard an external service with

10
00:00:50,490 --> 00:00:51,410
too many messages.

11
00:00:51,930 --> 00:00:54,740
So let's have a look at this in practice here.

12
00:00:54,750 --> 00:01:05,250
I've got a trigger that sent out the timestamp and I've got a debug note to show us the exact time stamp

13
00:01:05,250 --> 00:01:13,160
at the moment, what I trigger it, and then the time stamp trigger will also start the delay node.

14
00:01:13,170 --> 00:01:22,500
So I've got five seconds delay and after five seconds, the delayed message debug node will fire and

15
00:01:22,500 --> 00:01:25,630
show us the payload five seconds later.

16
00:01:26,550 --> 00:01:29,220
So let's try this out.

17
00:01:29,610 --> 00:01:32,580
Looking at the current flow, I'm going to trigger that inject node.

18
00:01:38,130 --> 00:01:46,020
And they go five seconds later, the same payload is let through by the DeLay node so he can see it

19
00:01:46,020 --> 00:01:46,340
here.

20
00:01:47,010 --> 00:01:49,140
Another thing that is interesting is this.

21
00:01:49,320 --> 00:01:58,980
Let's say that I generate multiple timestamps within a small amount of time just by clicking on the

22
00:01:58,980 --> 00:02:00,450
button here multiple times.

23
00:02:00,450 --> 00:02:01,320
It looks like this.

24
00:02:03,160 --> 00:02:10,630
So you can see that I've got a fairly high rate of messages being produced and all those are delayed

25
00:02:10,630 --> 00:02:14,860
by five seconds and eventually they do appear just five seconds delayed.

26
00:02:15,730 --> 00:02:23,980
Know, what I can do instead is I can say that I want to limit the rate of those messages and I want

27
00:02:23,980 --> 00:02:30,040
to drop any intermediate messages so that only one message per second is actually able to pass through.

28
00:02:30,880 --> 00:02:32,920
So let's see what the effect of this is.

29
00:02:32,920 --> 00:02:41,140
I'm going to do multiple clicks on this button to simulate a high rate of messages passing through the

30
00:02:41,140 --> 00:02:41,530
flow.

31
00:02:42,280 --> 00:02:46,090
And that is what happens in the output in the delete message debug node.

32
00:02:50,200 --> 00:02:55,720
OK, so I've got a bunch of royal messages here, you see the first delayed message did come through

33
00:02:55,720 --> 00:03:00,850
and then I've got a bunch of royal messages until another message came through.

34
00:03:01,180 --> 00:03:05,890
But these messages, you can see the time stamps should be of a second part.

35
00:03:07,120 --> 00:03:07,900
So thirty eight.

36
00:03:07,900 --> 00:03:11,830
Thirty eight seconds and then you've got thirty nine seconds.

37
00:03:12,190 --> 00:03:18,640
Instead of having multiple messages coming through to match the rate by which I was clicking on the

38
00:03:18,640 --> 00:03:24,620
button here to exaggerate a little bit more to make this a little bigger.

39
00:03:24,850 --> 00:03:25,840
Five seconds.

40
00:03:26,290 --> 00:03:31,430
So one message per five seconds and it drops the intermediate messages.

41
00:03:31,450 --> 00:03:33,910
So those are totally lost for good.

42
00:03:34,250 --> 00:03:39,970
Deploy that and clean up and I'm going to do a few consecutive clicks on the timestamp node.

43
00:03:46,790 --> 00:03:54,900
OK, so let's go back to the beginning, his first delete message at 39, nine, 34, four minutes or

44
00:03:55,100 --> 00:03:58,060
so, 39 minutes and 34 seconds.

45
00:03:58,550 --> 00:03:59,930
And the next one.

46
00:04:01,260 --> 00:04:04,140
So they put a number here for the next one.

47
00:04:09,420 --> 00:04:16,390
It's right here, 39, exactly five seconds later, we have a single message coming out of the delayed

48
00:04:16,390 --> 00:04:22,330
message, so we will be using the delay node in our project later on.
