0:00 All right, so now we're finally ready to actually 0:02 create the subscription 0:04 to the underlying CurrentDB event stream. 0:07 In order to do this, the first thing I wanna do 0:09 is create a new member variable 0:11 that will actually hold the subscription in memory, 0:15 and this will allow us to interact with it 0:18 later on. So let's go ahead and mark a new private 0:22 subscription field 0:24 of type all 0:26 stream subscription, 0:28 and we'll see this all stream and what it is in a second as we set it 0:32 up. 0:32 And so now back inside of run, we're gonna set 0:36 this.subscription equal to... Well, now at this point, 0:40 we need to get access to the underlying event store, which 0:44 we know we can do through our dependency injection. 0:48 So let's go ahead and now inside of the constructor 0:51 add another dependency, which will be our 0:55 event store that we've created in the previous lectures. 0:58 Uh, and we know this is where we actually establish the 1:01 connection to 1:02 CurrentDB. 1:04 And so now with the event store available, we can use it to 1:08 implement a new method that allows us to subscribe to all. 1:12 Now, as I explained in the previous lecture, 1:14 the all subscription 1:16 is a special global subscription that 1:19 automatically will listen to all of the underlying event 1:23 streams inside of CurrentDB. Now, of course, doing this could be 1:27 very 1:28 process-intensive if you have a lot of event streams 1:32 in your 1:34 store, and this is why we can filter down to only 1:37 listen 1:38 for the streams that we care about. 1:41 So to do this, let's head back into the event store 1:44 service and 1:44 add this functionality. In here, I'm gonna scroll down and implement 1:48 a new subscribe 1:51 to all method. This can take in the 1:54 subscribe to all options from CurrentDB 1:59 client, and now all we're gonna do is return this .client, the
The rest of the transcript is for members.
Sign in