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.
Hey,
This is a draft with an idea for discerning which UoW commit we're running the events for.
The idea behind this is that as of now I'm unable to detect what is the "context" for the events being sent. As such, it is not possible to properly queue things with PostFlush in our event library here.
I'd like to be able to detect the context the events are running in, as I might delay dispatching of symfony events until PostFlush occurs. As of now, any events which fit the criteria will be added to a dispatch queue, which once ran will trigger more events, which then may in turn trigger more events... etc etc.
The point is not to stop this behavior, but rather to detect the correct order of dispatching of said events, for which I'd need the functionality below.
I would appriciate all and any feedback, along with information if you'd consider adding said feature, should it be done to your satisfaction. For now, this is simply an idea, might also be in the incorrect branch, but I don't think it's a BC break? (though it might be because of the additional parameter)?
The CommitEventId logic could be simplified a bit by modifying the event in persistence, but I'm not sure that's a great idea.
PS. Isn't PrePersist called too early? Shouldn't it be called during UoW->Commit?