-
Notifications
You must be signed in to change notification settings - Fork 41
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 event handling methods #33
Comments
This issue depends on an open PR, which benchmarks the apply method. I will provide more cases, especially for a switch construct. #32 I would like to decide if a event is handled by an "on" method in the aggregate. With the current implementation i have to create always an empty 'when' method, if not. With your approach that would be possible. So +1 |
@oqq Please note this: In the event sourcing lib, there are less problems, as we always expect the event to be an instance of AggregateChanged. But in the service-bus a message (command, event or query) doesn't have to be an object. It can also be an array or string. So here an onEvent-method helps really a lot to handle those situations for listeners. |
Ok, so i write benchmarks for event sourcing with the assume it would be an instance of AggregateChanged. I have started to test against strings. Thanks for the hint. :) |
Looks good. Migrating existing code to this is also easy. You have to write a little bit more code, but the flexibility/performance is worth it. @oqq You find some extended bench examples here. |
We could provide some examples in docs, so the user could catch from templates for the implementation. Maybe with a reference to benchmarks. |
Prefer this method, looks more functional too. |
👍 for the approach |
Fallback is already available in this repo:
it's protected an can simply be overridden in userland code to achive the "new style". |
Currenty we use something like this:
New approach with be like this:
Reasons:
refers to: prooph/service-bus#109
The text was updated successfully, but these errors were encountered: