Skip to content

Conversation

@pkly
Copy link

@pkly pkly commented Sep 23, 2024

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?

@github-actions
Copy link
Contributor

There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.
If you want to continue working on it, please leave a comment.

@github-actions github-actions bot added the Stale label Dec 23, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2025

This pull request was closed due to inactivity.

@github-actions github-actions bot closed this Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant