Javadoc
EntitySubscriber allows to listen to entities (commands and events)
once they are committed. Use
Repository#addEntitySubscriber(EntitySubscriber)to add an entity subscriber.
When an event or a command are being processed, repository will
use
EntitySubscriber#matches(Entity) to determine whether
the entity is being subscribed to. Please note that it will store
entity UUID until the entire command is committed, so if your command
generates an extremely high number of events, you might experience
significant memory usage penalty.
Once a command is processed and committed,
EntitySubscriber#accept(Stream)is invoked with a stream of entity handles.
By default,
EntitySubscriber#accept(Stream) invokes
EntitySubscriber#onEntity(EntityHandle)for every entity handle.