WEBVTT

00:00.200 --> 00:01.520
Hi everyone.

00:01.520 --> 00:06.960
In this video let's add a real time for remote message.

00:07.800 --> 00:14.520
So right now release the video and try to do that okay.

00:14.560 --> 00:23.960
Let's think a little bit and try to create the real time folder remote okay.

00:26.440 --> 00:28.800
So how about your solution.

00:29.400 --> 00:32.000
Let me show you how I can do that.

00:33.080 --> 00:35.280
Let's take a little bit right here.

00:36.280 --> 00:41.960
In order to remove the message we need the ID right.

00:42.240 --> 00:50.120
And let him how the front end can consume the data from the subject server okay.

00:50.160 --> 00:55.120
The socket server will emit the event to the front end.

00:55.240 --> 01:01.000
And let's take a little bit about how the front end can remove that okay.

01:01.360 --> 01:02.040
Possible.

01:02.080 --> 01:06.360
In the in the front end we have a list of messages okay.

01:07.360 --> 01:13.710
And we want to Remove sub message from dask array.

01:14.310 --> 01:16.190
How we can do that?

01:16.670 --> 01:19.430
Well, if you think in very similar.

01:19.550 --> 01:20.790
We have a arrays.

01:22.790 --> 01:23.390
Okay.

01:23.430 --> 01:27.830
And in order to remove we should filter out us right.

01:27.870 --> 01:29.390
We can use filter method.

01:37.950 --> 01:38.510
Okay.

01:38.670 --> 01:41.110
We will remove using this one.

01:41.350 --> 01:41.910
Right.

01:42.230 --> 01:49.230
It means the socket error here is somehow send the ID and not the right.

01:49.790 --> 01:50.310
Okay.

01:50.830 --> 01:56.830
After we already found the message, we will have something like message, right?

01:57.230 --> 02:05.430
And we just need to update update that for example like file message.

02:05.430 --> 02:12.270
And we just need to or actually this is not removed entirely.

02:12.270 --> 02:15.750
We just need to update the message which is deleted.

02:16.270 --> 02:16.790
Right.

02:16.990 --> 02:25.500
So for that reason in the front end, we will yield something like that, like file index.

02:30.700 --> 02:31.180
Okay.

02:41.660 --> 02:48.620
After we already found the index, we just need to know the message right here.

02:49.460 --> 02:49.980
Right.

02:50.020 --> 02:53.860
Dot index and dot delete.

02:53.900 --> 02:56.580
We need to update it back to false.

02:56.940 --> 02:58.820
And we will set the new style.

02:59.220 --> 02:59.580
Okay.

02:59.620 --> 03:00.940
With this information.

03:01.500 --> 03:01.900
Okay.

03:01.940 --> 03:05.220
That's how frontend can consume this data.

03:05.660 --> 03:11.300
It means right now in the socket data right here we need the underscore ID okay.

03:11.340 --> 03:17.780
We just need to send the underscore ID about what message we want to remove.

03:18.300 --> 03:25.900
And the frontend it will consume that and it will remove from that array okay.

03:26.740 --> 03:27.480
It Between.

03:27.520 --> 03:31.760
With this way, the front end will handle the logic.

03:31.800 --> 03:33.480
Okay, the front end will.

03:35.800 --> 03:42.120
File the message and update its back to true.

03:42.680 --> 03:47.240
Alright, so that's about the solution.

03:47.440 --> 03:50.480
It means right here what we need to do.

03:50.520 --> 03:55.040
We need to create the message gateway okay.

03:55.080 --> 03:55.680
Handler.

03:58.040 --> 04:00.480
Remove message.

04:02.600 --> 04:07.360
Right here we need to send the ID okay.

04:07.800 --> 04:10.520
Maybe I will call the message over here.

04:12.800 --> 04:17.600
And I will say that this dot server.

04:17.920 --> 04:20.680
And we also need the conversation.

04:21.160 --> 04:21.640
Right.

04:36.470 --> 04:37.590
Pre-war prices.

04:40.550 --> 04:42.110
Were okay.

04:42.150 --> 04:43.430
We just need to send a message.

04:43.470 --> 04:51.870
And a broader client and client will care about us.

04:52.590 --> 04:54.390
So it's a message of it.

04:54.670 --> 05:04.310
I will call this message gateway dot handle, remove message and move the conversation.

05:10.670 --> 05:17.150
And message and I will come from message over here underscore ID okay.

05:18.070 --> 05:20.670
And dot two string also.

05:21.590 --> 05:25.750
So that is very easy right.

05:26.110 --> 05:29.270
So I hope you right now already got the idea.

05:29.630 --> 05:34.310
And so the next part will be the marketing message.

05:34.750 --> 05:42.350
So please pause the video and uh let's do that.

05:42.750 --> 05:44.670
I will see you in the next one.
