@@ -237,7 +237,6 @@ class CountProjection(Projection[CountRecorderInterface]):
237237
238238 @singledispatchmethod
239239 def process_event (self , event : DomainEventProtocol, tracking : Tracking) -> None :
240- print (" Process event:" , event)
241240
242241 @process_event.register
243242 def aggregate_created (self , event : Dog.Registered, tracking : Tracking) -> None :
@@ -268,7 +267,8 @@ with ProjectionRunner(
268267 tracking_recorder_class = POPOCountRecorder,
269268) as runner:
270269
271- # Get "read model" instance.
270+ # Get "read model" instance from runner, because
271+ # state of materialised view is stored in memory.
272272 materialised_view = runner.projection.tracking_recorder
273273
274274 # Wait for the existing events to be processed.
@@ -277,14 +277,14 @@ with ProjectionRunner(
277277 training_school.recorder.max_notification_id(),
278278 )
279279
280- # Query the read model.
280+ # Query the " read model" .
281281 dog_count = materialised_view.get_dog_counter()
282282 trick_count = materialised_view.get_trick_counter()
283283
284- # Write another event.
284+ # Record another event in "write model" .
285285 notification_id = training_school.add_trick(' Fido' , ' sit and stay' )
286286
287- # Wait for the new event to be processed.
287+ # Wait for the new event to be processed by the projection .
288288 materialised_view.wait(
289289 training_school.name,
290290 notification_id,
0 commit comments