Skip to content
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

WIP: EventStream Test #314

Closed
wants to merge 2 commits into from
Closed

WIP: EventStream Test #314

wants to merge 2 commits into from

Conversation

bwaidelich
Copy link
Member

No description provided.

@bwaidelich
Copy link
Member Author

It's a major design flaw that EventStorageInterface::load() returns an EventStream (https://github.com/neos/Neos.EventSourcing/blob/master/Classes/EventStore/Storage/EventStorageInterface.php#L32) since the event stream requires an instance of the EventNormalizer (https://github.com/neos/Neos.EventSourcing/blob/master/Classes/EventStore/EventStream.php#L43)

Bastian Waidelich
=> for custom event type converters etc. we always have to create a dedicated EventStorage instance and the factory won't support that out of the box

Bastian Waidelich
(Stumbling upon this while working on the ESCR)

Alexander Berl
Well, it should maybe be an EventStreamInterface now - the requirement of a normalizer came later. Or what are you thinking of?

Bastian Waidelich
To be honest: I think and interface wouldn't help (and IMO interfaces should only be used as markers and for service classes).
I think the whole EventStore part should not know anything about DomainEventInterface. The conversion should happen later and lazily.
That means that the EventStream would stream the "RawEvents" basically.
This would solve many issues along the way:
#241
#94 (and #191)

Bastian Waidelich
but I don't know why we didn't at least make the return type EventStreamIteratorInterface

Bastian Waidelich
That way we would only need to change the line return $this->storage->load($streamName, $minimumSequenceNumber) in EventStore::load() to return new EventStream($streamName, $this->storage->load($streamName, $minimumSequenceNumber), $this->eventNormalizer);

Bastian Waidelich
This was really a missed opportunity: #314

Bastian Waidelich
But since this is a breaking change, I would rather take this one step further for a solid 3.0

@bwaidelich
Copy link
Member Author

I won't work on this in the forseeable future – feel free to take over :)

@bwaidelich bwaidelich closed this Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant