-
Notifications
You must be signed in to change notification settings - Fork 0
Event bus #4
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 e 8000 mails.
Already on GitHub? Sign in to your account
base: add-message-component
Are you sure you want to change the base?
Event bus #4
Conversation
…small comments on the PR.
…an find automatically the Message handler is supposed to handle
That's a very interesting question here. As of now, I don't think that we need such "event bus" in the "default package". All you need - as a user - is to define multiple buses if you'd like to (maybe we can use some configuration in the FrameworkBundle). Therefore, I'll mention this PR in the Symfony PR :) |
The problem is that just multiple buses is not enough. You really need to store the events somewhere and dispatch them after the current bus is done with them. You don't know what other middlewares will do. |
Oh yeah, and the "store middleware" you've added :) |
Deleted. Will move this into the symfony thread |
1c81979
to
56d5da4
Compare
This PR was merged into the 3.3 branch. Discussion ---------- Restore RoleInterface import | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no <!-- don't forget to update UPGRADE-*.md files --> | Tests pass? | yes | License | MIT The import is use on PHPDoc but was accidentally removed. Maybe because PHPStorm does not match with the import when you use parenthesis. Not really a bug as it is concerning only PHPDoc, but it make some analysis tools like PHPStan yelling: ``` ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Line src/AppBundle/Security/Authentication/ApiKeyAuthenticator.php ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 64 Parameter #4 $roles of class Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken constructor expects array<string|Symfony\Component\Security\Core\Authentication\Token\RoleInterface>, array<string|Symfony\Component\Security\Core\Role\Role> given. ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Line tests/AppBundle/Controller/WebTestCase.php ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 59 Parameter #4 $roles of class Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken constructor expects array<string|Symfony\Component\Security\Core\Authentication\Token\RoleInterface>, array<string|Symfony\Component\Security\Core\Role\Role> given. ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ``` Commits ------- 8ecfeb1 Restore RoleInterface import
3967eda
to
e63c5b9
Compare
86a91ec
to
c091d66
Compare
This adds the Event bus along with the Message bus.
The example in current documentation, with email sending is bad(TM) so we need to find a better one.
Imagine that we have an middleware that wraps command handling into an transaction. This means that the commit will happen after the command has been handled, and if there is something wrong during the commit, we could have easily already sent the email however the user wasn't persisted.
What should instead happen 8000 is that message handler that created an user should instead
record
an event/new message at the end of the__invoke
function.Then there should be middleware that's executed last which gets the recorded events and publishes them to another bus named Event bus.
example bellow:
the recorder is taken directly from SimpleBus, that's the reason behind the author tag. I hadn't done any renaming as there will probably be a lot of discussion here.
@sroze will you merge this so the discussion happens in the main Symfony repo?