-
-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overhaul CatchUp and CatchUpHook implementation #4289
Comments
hey :) I am not fully sure about this, because that was IMHO the way it was done before (In Neos.EventSourcing) - I think we had some reasons to do it differently, or am I wrong? :) IMHO it also had to do with the EventEnvelope deserialization (which the framework knows nothing about). All th ebest <3 |
No, you're totally right. But IMO that was the "wrong cut" because now we have a lot of duplication and – worse – inconsistencies (e.g. missing support for CatchUp Hooks).
The framework (as in interface ProjectionInterface {
public function reset(): void;
public function canHandle(Event $event): bool;
// ...
}
interface ToBeNamedInterface {
public function apply(EventInterface $domainEvent): void;
}
interface ToBeNamedLowLevelInterface {
public function catchUp(EventStreamInterface $eventStream): void
} (but IMO we should first see if there are really many cases where we need the raw events – currently there are none IIRC) |
As discussed with @skurfuerst we decided to change the interface from interface ProjectionInterface {
public function canHandle(Event $event): bool;
public function catchUp(EventStreamInterface $eventStream, ContentRepository $contentRepository): void;
} to interface ProjectionInterface {
public function canHandle(EventInterface $domainEvent): bool;
public function apply(EventInterface $domainEvent): void;
} Note: We won't need the Breaking ChangesThis change would not be breaking to users of the APIs, but Implementations of custom projections are affected of course |
Currently there's a lot of duplication in the
catchUp()
methods of projections and support for catch up hooks has to be implemented manually (seeneos-development-collection/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php
Lines 187 to 197 in 448a2d1
We should probably replace
by something like
in the
ProjectionInterface
and move the looping/catchup hook logic out.Projections that need more control over the whole event stream could opt in with some additional interface if we need it at all.
The text was updated successfully, but these errors were encountered: