WEBVTT

00:05.290 --> 00:10.180
So guys, now finally we will going to implement the notification and subscription.

00:10.180 --> 00:17.080
So so far we have created a publisher thread and we have created a couple of subscriber threads and

00:17.080 --> 00:22.480
we have implemented a data source which is nothing but a routing table, and it is the publisher thread

00:22.480 --> 00:25.060
which performs Crud operations on this data source.

00:25.060 --> 00:25.650
Right.

00:25.660 --> 00:32.260
So far we have not yet implemented any mechanism using which subscriber can express their interest in

00:32.260 --> 00:34.540
the particular entry of a data source.

00:34.540 --> 00:40.930
And also we have not implemented any mechanism using which whenever a publisher updates the data source,

00:40.960 --> 00:44.320
a notification is sent to the subscriber about the update.

00:44.320 --> 00:44.980
Right?

00:44.980 --> 00:47.710
So this is what we will going to implement next.

00:48.100 --> 00:50.800
So we will going to implement the subscription.

00:50.800 --> 00:57.490
Subscription means that allow subscribers to subscribe or unsubscribe for a particular entry of interest

00:57.490 --> 00:58.840
for notifications.

00:58.930 --> 01:05.200
So it is the subscriber responsibility to express interest in a particular entry in a data source.

01:05.200 --> 01:07.720
And the other part is the notification.

01:07.720 --> 01:14.410
That is, whenever the publisher updates any entry in the data source, we need to notify all the subscribers

01:14.410 --> 01:20.230
which are interested in that particular entry whenever that entry is updated by the publisher.

01:20.230 --> 01:20.950
Right.

01:20.950 --> 01:26.680
So notification is a communication from the data source to the subscriber where a subscription is a

01:26.680 --> 01:29.950
communication from the subscriber towards the data source.

01:30.100 --> 01:36.340
Now note that in this diagram we have precisely captured the architecture of a publisher subscriber

01:36.340 --> 01:37.090
model.

01:37.090 --> 01:43.720
In this architecture you can see that publisher is absolutely unaware of the presence of subscribers.

01:43.720 --> 01:47.200
Publisher don't even know there is any subscriber or not.

01:47.200 --> 01:50.680
All publisher does is to update the data source.

01:50.680 --> 01:51.310
Right?

01:52.250 --> 01:56.390
It is the data source which is aware of the subscribers, right.

01:56.840 --> 02:01.850
So let us see how we will going to implement the mechanism of subscription and notification.
