Change the event subscribe interface to require specifying a specific event #242
Labels
breaking-change
This indicates that this ticket will most likely be a breaking change
enhancement
New feature or request
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 toAddSubscriber(eventName string, handler EventHandler)
and that would allow for customization to improve security etc.The text was updated successfully, but these errors were encountered: