-
-
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
TASK: Yield events to publish in workspace command handler #5315
Merged
kitsunet
merged 10 commits into
neos:9.0
from
mhsdesign:task/schnappsidee-zwo-yield-events-to-publish-in-workspace-command-handler
Oct 24, 2024
Merged
TASK: Yield events to publish in workspace command handler #5315
kitsunet
merged 10 commits into
neos:9.0
from
mhsdesign:task/schnappsidee-zwo-yield-events-to-publish-in-workspace-command-handler
Oct 24, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using generators will allow us to omit the direct publishing via ->publishEvents or sub command handling via ->handle For exception cases - on a ConcurrencyException - it will be possible to notice the failure in the command handler and act accordingly (by emitting another event and than raising another error). If no error strategy is provided the `ConcurrencyException` will be rethrown into the outer world: ```php $publishResult = yield new EventsToPublish(...); if ($publishResult instanceof EventsToPublishFailed) { yield new EventsToPublish(...); throw new BaseWorkspaceHasBeenModifiedInTheMeantime(); } ``` Catchups will be invoked after each yield to ensure that the system is atomic.
And enforce type of `RebasableToOtherWorkspaceInterface` earlier. To be noted: The rebase and discard operation previously only required `fromArray` to be implemented, now we also strict check against: RebasableToOtherWorkspaceInterface
rebase, discard & publish individual will be migrated via
mhsdesign
commented
Oct 23, 2024
bwaidelich
reviewed
Oct 23, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great already! Some first comments
Neos.ContentRepository.BehavioralTests/Classes/Command/PerformanceMeasurementService.php
Outdated
Show resolved
Hide resolved
...s/Tests/Behavior/Features/ContentStreamForking/01-ForkContentStream_ConstraintChecks.feature
Outdated
Show resolved
Hide resolved
Neos.ContentRepository.Core/Classes/EventStore/EventsToPublishFailed.php
Outdated
Show resolved
Hide resolved
Neos.ContentRepository.Core/Classes/Feature/ContentStreamClosing/Command/CloseContentStream.php
Show resolved
Hide resolved
mhsdesign
commented
Oct 23, 2024
mhsdesign
commented
Oct 23, 2024
Neos.ContentRepository.Core/Classes/Feature/ContentStreamHandling.php
Outdated
Show resolved
Hide resolved
…/ContentStreamForking/01-ForkContentStream_ConstraintChecks.feature Co-authored-by: Bastian Waidelich <b.waidelich@wwwision.de>
mhsdesign
commented
Oct 23, 2024
Neos.ContentRepository.Core/Classes/Feature/ContentStreamClosing/Command/CloseContentStream.php
Show resolved
Hide resolved
6 tasks
we will open a dedicated pr to get rid of the forkCommandUseHere
bwaidelich
approved these changes
Oct 24, 2024
kitsunet
approved these changes
Oct 24, 2024
mhsdesign
deleted the
task/schnappsidee-zwo-yield-events-to-publish-in-workspace-command-handler
branch
October 24, 2024 16:25
mhsdesign
added a commit
to mhsdesign/neos-development-collection
that referenced
this pull request
Oct 26, 2024
fyi as we do a rebase now instead of failing if a rebase is necessary, we dont need the error handling:
and thus i removed the complexity -> 3679157 |
neos-bot
pushed a commit
to neos/contentrepository-core
that referenced
this pull request
Oct 28, 2024
…command handler Before 394db57 we required the ->throw() behaviour of neos/neos-development-collection#5315 to catch the `ConcurrencyException` inside in the command handler.
mhsdesign
added a commit
to mhsdesign/neos-development-collection
that referenced
this pull request
Nov 9, 2024
… version instead Also readd lost documentation and simplifies the `handle` The ->throw logic was initially introduced via neos#5315 but then removed again as we thought it was no longer needed.
neos-bot
pushed a commit
to neos/contentrepository-core
that referenced
this pull request
Nov 12, 2024
… version instead Also readd lost documentation and simplifies the `handle` The ->throw logic was initially introduced via neos/neos-development-collection#5315 but then removed again as we thought it was no longer needed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1.) Allow command handlers to yield EventsToPublish
Using generators will allow us to omit the direct publishing via ->publishEvents or sub command handling via ->handle
For exception cases - on a ConcurrencyException - it will be possible to notice the failure in the command handler and act accordingly (by emitting another event and than raising another error).
If try catch is used the
ConcurrencyException
will be rethrown into the outer world:Catchups will be invoked after each yield to ensure that the system is atomic.
2.) Cleanup RebasableToOtherWorkspaceInterface extraction
And enforce type of
RebasableToOtherWorkspaceInterface
earlier.To be noted: The rebase and discard operation previously only required
fromArray
to be implemented, now we also strict check against: RebasableToOtherWorkspaceInterface3.) Avoid use of sub commands in WorkspaceCommandHandler
rebase, discard & publish individual will be migrated via #5301
Upgrade instructions
Review instructions
Checklist
FEATURE|TASK|BUGFIX
!!!
and have upgrade-instructions