Skip to content
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

Change the event subscribe interface to require specifying a specific event #242

Open
akeemphilbert opened this issue Feb 12, 2023 · 0 comments
Labels
breaking-change This indicates that this ticket will most likely be a breaking change enhancement New feature or request

Comments

@akeemphilbert
Copy link
Contributor

Currently handlers can subscribe to the event dispatcher by simply calling the AddSubscriber method. The implication has been each handler has to have an if statement to only respond to the events it cares about. This was manageable but if we were to consider exposing the event system to 3rd parties then those 3rd parties would have access to the entire event stream. It is more ideal to force event handler to subscribe to a specific event the signature would change to AddSubscriber(eventName string, handler EventHandler) and that would allow for customization to improve security etc.

@akeemphilbert akeemphilbert added enhancement New feature or request breaking-change This indicates that this ticket will most likely be a breaking change labels Feb 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change This indicates that this ticket will most likely be a breaking change enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant