Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Messenger] Add messenger configuration to make a message bus not get all handlers by default#42693
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:7.4
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
carsonbot commentedAug 23, 2021
Hey! To help keep things organized, we don't allow "Draft" pull requests. Could you please click the "ready for review" button or close this PR and open a new one when you are done? Note that a pull request does not have to be "perfect" or "ready for merge" when you first open it. We just want it to be ready for a first review. Cheers! Carsonbot |
carsonbot commentedAug 24, 2021
Hey! I think@ruudk has recently worked with this code. Maybe they can help review this? Cheers! Carsonbot |
Uh oh!
There was an error while loading.Please reload this page.
When working withmultiple Messenger buses, it's common to restrict a handler to certain bus(es) using the tag properties. This is useful if you have handlers that all belong to specific buses, but becomes more complicated when there are more combinations of (default and non-default) buses and handlers.
For example if you have a bus to handle new messages and want to introduce a bus that only handles a migrations process' messages in the background. If the handlers for "new messages" should keep handling only those, then you'd suddenly need to make that explicit for all those handlers, because otherwise they'd be added to the "migration process" bus too. And if a third party bundle also registers message handlers, you'd need to restrict those to the specific bus(es) too, if even possible.
This can be improved (IMHO) with a simple addition, by adding a configuration value for the messenger configuration (
framework.messenger.buses[].default_handlers
) that determines if the bus is added by default to handlers. This then stores this config in a tag property, which can be read in theMessengerPass
. The change would be fully backwards compatible. I'd first like to know if this is in line with the Messenger component's way of working and something that could be added. I can add/fix tests, codestyle etc after discussion.